BearerToken_Api_Trigger

fetch(“https://cloud.uipath.com/ensarautomation/DefaultTenant/orchestrator_/t/24cb78d2-4571-4373-9c44-30c63efe4e7a/Send_Google_Form”, {
headers: {
Authorization: “Bearer INSERT_YOUR_TOKEN”,
“Content-Type”: “application/json”
},
body: {},
method: “POST”
}) how can i get the bearer token for this fetch method to trigger the process via api

@bhaskar ,

Please follow these steps.

Thanks,
Ashok :slight_smile:

Hi @bhaskar

Follow this:

Hope it will helps you :slight_smile:
Cheers!!

I got the token ashok. Thanks a lot. But how many days this token is valid ?

Is valid for 30 mins. You will have send https request again after 30 min get the latest token.

Also please accept my answer.

Thanks,
Ashok :slightly_smiling_face:

so i should probably send the request to get the bearer token first and then get the token from it and use that token to send api trigger request right ?

The best practice we are using currently is to store the token in credential asset and it’s retrieval time in an string asset.

Before every API call we compare Last Token Retrieval time from asset and current time. If the difference is beyond 28 minutes, get a fresh token else reuse the previous token from asset.

Thanks,
Ashok :slight_smile:

Great. so I have to implement the code to store and get credential asset. dont we need bearer token for getting and storing credential assets ?

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