Access token for more than 1 day in UiPath Cloud Orchestrator

Hello,

We’re using the UiPath Cloud Orchestrator Community Edition, and we are trying to do a PoC for the management.

Currently, we made 2 processes to automate in the PoC, and we spent the whole day just figuring out how to get the [access_token] and the [service_instance_logical_name] to be able to run jobs from a standalone system that we are creating.

We don’t have much experience in this, and would need your expertise in this.

First, how can I make the [access_token] to be always valid, because I read in the article of ‘consuming-cloud-api’ that

Blockquote
The [access_token] required for making API calls is valid for 24 hours. You have to regenerate [access_token] and [id_token] using your [refresh_token] , otherwise you receive 401 status code.
Blockquote

How can I make it more than 1 day? And if it is not possible, how can I automatically generate it without the need of us going manually everyday to extract the [access_token]?

And if we move to Enterprise Edition, is it better than the cloud version?

Thanks

Heyy @Salem_Ababneh,

It is not possible to make it valid for one day as you are using the cloud API, but you can automatically send a request to generate the refresh access token which will again be valid for one more hour. Here are the clear steps to do that, as you did some of them, go with the step which is related to refresh token :slight_smile:

2 Likes

Amazing article! That sums it up, but I have a quick question.

Why did you authenticate through this link at the end and you already got the [access_token] in step 4 Getting Refresh Token?

https://platform.uipath.com/api/account/authenticate

Because you already got the [access_token] in step 4 Getting Refresh Token:

Anyway I have tried authenticating through it and using these parameters:

Post - https://platform.uipath.com/api/account/authenticate
Authorization: Bearer [Token_ID]
Content-Type: application/json
{
“tenancyName” : “[Tried accountName, accountLogicalName, serviceInstanceName, and serviceInstanceLogicalName]”,
“usernameOrEmailAddress” : “[my email]”,
“password” : “[my password]”
}

The response is:

{
“message”: “Invalid credentials, failed to login.”,
“errorCode”: 1000,
“resourceIds”: null
}

And I’m 100% sure my credentials are right.

Hey Salem, look for my post.
It’s bloody confusing, but even though they have this on their documentation and swagger / postman API templates, you should not try to authenticate using email and password. You will have to use this once when generating the first refresh (but it’s manually done) then you only authenticate with bearer access_token and bearer id_token depending on the task

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