Getting 401 - Anauthorized error while sending request to Orchestrator using odata/Jobs/UiPath.Server.Configuration.OData.StartJobs endpoint

Hello,

I am encountering a 401 - Unauthorized error while sending a request to the following endpoints. I use community edition.

This API was working fine until the previous day, but it suddenly stopped functioning. Has anyone else experienced this issue? Is there any changes in API functionality?

I am sending request through postman tool.

I use following endpoints.

For Token:
https://account.uipath.com/oauth/token

For get release key
https://cloud.uipath.com/{org name}/{Tenantname}/orchestrator_/odata/Releases?$filter=‘packageName’

For Start Job
https://cloud.uipath.com/{org name}/{Tenantname}/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs

Input argument:
{
“startInfo”: {
“ReleaseKey”: “XXXXXX”,
“Strategy”: “ModernJobsCount”,
“RobotIds”: [XXXXXX],
“NoOfRobots”: 0,
“Source”: “Manual”,
“InputArguments”: “{"requestDetails": {"requestDetails": testdata}}”
}
}

For authentication, I use bearer token which gets from the first token call. I am not able to get release key also.

Regards,
Keyur

Hi @tejalj.hipl

Looks like some issue in community version started yesterday.

@loginerror
Are you able to look into this please?

few users have reported the same error which started happening for them yesterday suddenly. Looks like some change in community version has affected these users.

i am also attaching other post where 2 more users are facing this issue.

I had an API token from a year or two ago, and it no longer works. I’m able to authenticate and retrieve a bearer token, but when using the the bearer token, it returns a 401 unauthorized code.

Also, the user account which connects, be it a configured application setup or an actual user, must also have permissions to start / create a job.
So either the right access scope or the right personal access rights.

Hi @swridings

When did it last work?

Are you able to confirm that you have set up external application for same and then using the creds from same to get a token?

if not, are you please able to show how are you retrieving token?

I was able to get this to work. I created a personal access token and used this as the bearer token with my API calls.

1 Like

Hi @swridings

That’s good to know.

@tejalj.hipl
Could you also try creating PAT and making use of same?

Else you can consider creating external application and use client id and secret from same to generate your access token.

Hi @sonaliaggarwal47,

I tried with both PAT and External Application as you suggested. Now I am able to send the request from Postman, and the BOT executes successfully.

The changes I made are:

  1. Updated the token URL from
    https://account.uipath.com/oauth/token
    to
    https://cloud.uipath.com/identity_/connect/token

  2. Changed the Grant Type from refresh_token to client_credentials.

  3. Added the Scope value.

Thank you everyone for your prompt support and assistance.

Thank you very much @sonaliaggarwal47 for your assistance.

Regards,
Keyur

1 Like

@tejalj.hipl

Glad to hear it helped:)

Now that your issue is resolved, kindly consider marking the post that helped as solution so this topic can be closed.

Regards
Sonali

Can someone confirm if this is changed recently? If yes, can you please help with relevant documents?

Thanks!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.