To conclude this discussion - I am sharing the solution which i found with the help of above comments. Thank You @Anil
First step is to create an external app from the admin screen and get the client_id and client secret.
Next step is to get Bearer Token. Use end point as below
orchesetratorURL+“/identity_/connect/token”
Add following parameters
grant_type as “client_credentials”
client_id from above step
client_secret from above step
scope from above step
Method as POST and accepted response as JSON. Deserialize and get the token ready
Third step is to get all the groups available
For this - we need to find the partitionGlobalId specific to organization level. To get partitionGlobalId - follow below steps
- Get partitionGlobalId. You can get this value by signing in to the tenant, opening developer tools, then extracting the value from there, see screenshot below. You can create a small automation to do that, but I’m still checking with product if there is an API that we can call to get this value, will get back to you on that one. This value should not change anyway for any given organization, so you can get it once and save it as a fixed value in a variable and use it in your app or automation.
For getting all the groups -
use end point as https://uipath.xxxx.com/Identity_/api/Group/12fa80b0-6045-471e-8861-60559d2d77f6
where the last part is partitionGlobalId
Pass Authorization as one of the header. Bearer BearerToken
For getting users in each of the groups
Deserialize and start looping through each of the groups. Get the id of the group and use below end point. Headers will remain same as Authorization
https://uipath.xxxx.com/portal_/api/identity/Group/12fa80b0-6045-471e-8861-60559d2d77f6/593263e9-f720-4650-93aa-2d271f712585
Last portion is group id
second last is globalpartitionid
I hope this will help someone in future