Can't get the access token using api request

When trying to get access token using postman
main_url = “https://cloud.uipath.com

Case 1
url - main_url + “/identity_/connect/token”
{
“grant_type”: “client_credentials”,
“client_id”: client_id,
“client_secret”: client_secret,
“scope”: “OR.Default”
}

we are getting this response
“invalid_client”

Case 2
the same happens when we are using
main_url + “/{{organization_name}}/identity_/connect/token”

Case 3
When we change url to
main_url + “/{{organization_name}}/default/identity_/connect/token”

we are getting response “200 ok”

Just wanted to let you know that before this we were using “grant_type” “refresh token” which was working correctly. But after the latest updates we couldn’t find the refresh token which we found from User Preferences=>Privacy & Security=>View API Access.

Hi @Artur_Khachatryan

For getting access token, endpoint url need to be like below:

https://cloud.uipath.com/{your organization name goes here}/identity_/connect/token

I see you are using scope as or.default.

Could you please confirm below:

  1. you have set up external application in automation cloud and retrieving client creds from there?
  2. Scopes are set or left blank in that registered application?

Could you please share screenshots of your registered application and the scopes you have provided in there?

Also could you please show screenshot form postman on how are you configuring the request details in there? using form-urlencoded option?

@Artur_Khachatryan

Welcome to Community!!

Follow below tutorials you can clear info about the API’s

If you find it helpful please mark the post as solution!

Happy Automation!!

Hello @Artur_Khachatryan

Welcome to the forums, I believe you are facing issue because of deprecation of the Tokens which got Migrated to PATs, check below and follow the instructions

For PATs, check below

Hope this helps you

If this Answers your question Like and Mark as solution

Thanks,
Srini