Orchestrator Cloud API authentication not working

Hi All, Currently i am trying to access the cloud api from postman. I am receiving the access token but when using the access token in subsequent api’s. i am receiving the following error,

{
    "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
}

Postman Request

    curl --location --request GET 'https://platform.uipath.com/[TenantName]/[Folder Name]/odata/Settings/UiPath.Server.Configuration.OData.GetLicense' \
    --header 'X-UIPATH-TenantName: [TenantName]' \
    --header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlJUTkVOMEl5T1RWQk1UZEVRVEEzUlRZNE16UkJPVU00UVRRM016TXlSalUzUmk4wSTBPQSJ9.eyJodHRwczovL3VpcGF0aC9lbWFpbCI6InJhamJjYTAwQGdtYWlsLmNvbSIsImh0dHBzOi8vdWlwYXRoL2VtYWlsX3ZlcmlmaWVkIjp0cnVlLCJpc3MiOiJodHRwczovL2FjY291bnQudWlwYXRoLmNvbS8iLCJzdWIiOiJnb29nbGUtb2F1dGgyfDEwMzM3MDkzODI4ODgwNjY0NDcxOCIsImF1ZCI6WyJodHRwczovL29yY2hlc3RyYXRvci5jbG91ZC51aXBhdGguY29tIiwiaHR0cHM6Ly91aXBhdGguZXUuYXV0aDAuY29tL3VzZXJpbmZvIl0sImlhdCI6MTU3OTU5NjAwOCwiZXhwIjoxNTc5NjgyNDA4LCJhenAiOiI4REV2MUFNTlhjelczeTRVMTVMTDNqWWY2MmpLOTNuNSIsInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgZW1haWwgb2ZmbGluZV9hY2Nlc3MifQ.VGGk1nMA73xEXv3N8St7g66ROsEDbvtszmX-FbRNXl-NN-sWza5RBqO9YngxaM89dohDwNCPqDZDjbljgcDjJkN6evNxBESnMZIvQu4DPp0ns3v2Owmz_a7SFIxTJS4esnzmOsa3NH0avYcZapnksl3oBdStPTfPbdUF4v_sBteCAg6IgtDqUOp-RlNcwSZKe_TqoYvnJjyiM1daExM1rgQ3xtvMYvX2Gbs32uesEapKvOEtRlxJI6weD3bb5kBF6X7-t4PStQBDdF1kwiHqGWkDDBgHVEI-AVWSMkhcH9wU1qdQ3DASZpbTGUqt8xECC6yz3UfvKybi0jdpHEirEw' \

Add this as a header

X-UIPATH-FolderPath
Value = Default

or change deafult to the name of the folder containing the process (orchestrator folder)

Same Results @Jersey_Practical_Sho

What are you actually trying to do? Start a Job?

Add queue item into cloud orchestrator

This creates a queue

Headers in Postman change tenant name

Authorizations change to bearer, paste access token in to box

Body

Request a new Access token and try again

Post URL
https://platform.uipath.com/odata/QueueDefinitions

Then all the same to add an item except for

URL https://platform.uipath.com//odata/Queues/UiPathODataSvc.AddQueueItem

and the body

{
“itemData”: {
“Name”: “NewQueue”,
“Priority”: “Normal”,
“SpecificContent”: {
“First”: “Some String Value Here”,
“First@odata.type”: “#String”,
“Second”: 516,
“Fourth”: “Did I skip the Third value?”,
“AnotherKey”: true
}
}
}

You should be calling this one to authenticate:
https://docs.uipath.com/orchestrator/v2019/reference#authenticating

I spend few hours today to get this f*** API integration to work :slight_smile:
Read a lot of interesting stuff on forum / official docs and http://dealetech.com/the-definitive-guide-to-uipath-cloud-orchestrator-2019-09-rest-api-authentication/

Finally for me it is much simpler

I use following method to get the Bearer token
https://account.uipath.com/oauth/token

{
  "client_id":"[Client Id value from Services => API Access]",
  "refresh_token": "[User Key value from Services => API Access]",
  "grant_type": "refresh_token"
}

Then I used this token + X-UIPATH-TenantName … and here was my mistake …

I put the [Service Name] as value instead of the Tenant Name that can be found in Services => API Access => Tenant Logical Name.

([Service Name] is the part you see in the URL https://platform.uipath.com/[AccountLogicalName]/[ServiceName])

With wrong Tenant Logical Name I was getting exactly same error message as @Rajesh_Manikandan.

2 Likes

Check out this post too:

KuRcZaK Thank you! I have been struggling for the last 4 days to figure this out… your post helped me to resolve the authentication Error.

Its amazing!

1 Like