Steps for authenticating and using Orchestrator cloud API

You have to pass it in the authorization which is available on the left side of the headers @Akhilesh_Thakur

It won’t look for headers or body for authorization. Pass it in the authorization field available

can you please check postman. In Authorization tab, which type I will use and how i pass id_token. Screenshot%20from%202019-10-15%2019-12-03

Use OAuth 2.0

In oauth 2.0, No any option to add existing token. For better understanding please install chrome extension of postman and check please.

Generally, Authorization token pass in header as Bearer.
I am successfully get data from https://platform.uipath.com/[account_logical_name]/[ service_instance_logical_name]/odata/Settings/UiPath.Server.Configuration.OData.GetLicense to pass Authorization: Bearer [access_token]
X-UIPATH-TenantName: [service_instance_logical_name]
in headers.

If you have the option directly as Bearer token, use that directly, or else OAuth 2.0

@Akhilesh_Thakur

In previous screenshot I am passing directly. Please check again.

I mean, If you see, I have Bearer token type available , so that I can pass the value directly selecting that, else you need to use OAuth 2.0

image

Hey @HareeshMR

I think this step is not needed:

Now as we have to authenticate with the URL in the previous versions of API, we need to send the final request for the URL

 URL : https://platform.uipath.com/api/account/authenticate
 Authorization code : ID token we got above
Header : Content-Type: application/json
Body : {
            "tenancyName" : "Documentation",
            "usernameOrEmailAddress" : "Documentation",
            "password" : "DocumentationAPItest"
            }

which will give us the access token which we can use for all the remaining requests like start job etc.,

Copy the result and use that result value in all the remaining requests :smiley:

By this point you already have all the codes after this step from the Orchestrator documentation:
https://docs.uipath.com/orchestrator/v2019/reference#section-getting-refresh-token

You don’t need to pass your credentials directly :scream:

2 Likes

@loginerror,

Will update that soon, Have to check that once :thinking:

1 Like

It working should be considered as an unreliable workaround that will be removed in the short-term feature :slight_smile:
(it was introduced to allow legacy solutions to continue to work with old credentials; however, this API call will not work for new tenants and should not be relied on)

1 Like

Hi,
i am stuck in the below step:
URL : https://platform.uipath.com/api/account/authenticate
Authorization code : ID token we got above
Header : Content-Type: application/json
Body : {
“tenancyName” : “Documentation”,
“usernameOrEmailAddress” : “Documentation”,
“password” : “DocumentationAPItest”
}

i am getting error in postman {
“message”: “Invalid credentials, failed to login.”,
“errorCode”: 1000,
“resourceIds”: null
}

can u please help?
Regards,
Manish

Please check the above reply from @loginerror, as per him, we don’t need that step to do. Please use the access token you have to start the job or any other request @Manish_Jawla

1 Like

Hi Hareesh,
When i tried to access other api like:
https://platform.uipath.com//odata/Environments?$expand={expand}&$filter={filter}&$select={select}&$orderby={orderby}&$top={top}&$skip={skip}&$count={count}

i got the below response.

{
“message”: “You are not authenticated!”,
“errorCode”: 0,
“result”: null,
“targetUrl”: null,
“success”: false,
“error”: {
“code”: 0,
“message”: “You are not authenticated!”,
“details”: “You should be authenticated (sign in) in order to perform this operation.”,
“validationErrors”: null
},
“unAuthorizedRequest”: false,
“__abp”: true
}

Hi Loginerror,

i am able to call api till below:
https://platform.uipath.com/cloudrpa/api/account/[account_logical_name]/getAllServiceInstances

after calling the above api, i am not able to call any api neither through postman or any other tool.
may i know the reason, why there is no proper documentation and video tutorial available for new release? i have used so many tools earlier they have proper documentation and everything.
Even for simple authentication for new cloud version i have so many documentation then it was finally done but again stuck for further integration. Is there any path which i can follow to integrate or call ui path api. please help
Regards,
Manish

Hi @Manish_Jawla

Could you try with the URL as so:
https://platform.uipath.com/yourAccountLogicalName/yourOrchestratorLogicalName

As per our documentation here:
https://docs.uipath.com/orchestrator/reference#consuming-cloud-api