How To Get The partitionGlobalID In API Query In Automation Cloud

How to get the partitionGlobalId in API Query in Automation Cloud?

To use API to realize user and group management in Automation Cloud, parameter partitionGlobalId is not found in the request body.

The definition of partitionGlobalId is 'The ID of the organization you want to retrieve the robot accounts for.' And on getting it through admin--tenants--orchestrator--API access--Organization ID, this one failed when trying to send API request, error message '{"errors":{"partitionGlobalId":["The value 'DatacomGroup' is not valid."]} '.

Actually, on trying to login to cloud.uipath.com, before the url jumped to https://cloud.uipath.com/tenant/portal_/home, it will display the following url for few seconds https://cloud.uipath.com/tenant/portal_/cloudrpa?organizationId=xxxxxx&ecommerceRedirect=false&isAuth0=true .The organisationID used in the url is the partitionGlobalID.

Another option to get the Partition ID, because the URL might load too fast to catch it,

  1. Open the developer tool on the browser before logging in, switch to Network tab and turn on the recording
  2. Log in the browser and select the tenant.
  3. After the page is loaded on the welcome screen, check the developer tool and copy the Request URL value.
  4. Paste on a notepad, extract the value and use it on the API call.

image.png

1 Like

For use in an API the partitionGlobalId can also be taken from an API request:

{{cloudUrl}}/{{cloudOrg}}/{{cloudTenant}}/orchestrator_/odata/Users/UiPath.Server.Configuration.OData.GetCurrentUser

The returned json contains the partitionGlobalId in the key AccountId.

To set this as a (environment) variable in a Postman request use this in a Postman request “Tests”:

// Parse the response JSON
var jsonResponse = pm.response.json();

// Extract the value of "AccountId" from the JSON response
var accountId = jsonResponse.AccountId;

// Set the "partitionGlobalId" environment variable with the extracted value
pm.environment.set("partitionGlobalId", accountId);

After the request is sent, the script will run and extract the AccountId value from the JSON response.
The extracted value will be set as the partitionGlobalId environment variable.
You can then use the partitionGlobalId variable in subsequent requests or any part of your Postman environment where you need this value.

If you download an app created on your orchestrator and open it in notebook - you can find your partitionid by searching for “url”:"https://cloud.uipath.com/ in notebook. The PGI is what follows the url (and the second / separates it from the TenantId).