API Workflows Studio | HTTP Request

I am currently working on API workflows for Orchestrator APIs for an Agent.

  1. I have authenticated via swagger and tested a couple of APIs within SWAGGER ( e.g. releases, processes, Robot Logs)
  2. I have provided the Get URL, Bearer token, and Accept Application/json as arguments
  3. However when I test in Studio- API workflows it runs Fine when I an debugging/testing, but after a while it fails to get the API HTTP Request. (see image)

How can I confirm, given the authentication that it will always work when querying via an Agent?

Hi, @ashton.lalchan This usually happens because your Bearer token expires after a while. Try refreshing or requesting a new token automatically in your workflow whenever you get an “unauthorized” error. That way your API calls will stay reliable even when running unattended

Hi @arjun.shiroya,

Thanks for the response, is there a specific activity/property for this in the API workflow?

I ask becuase the bearer token was manually entered in the workflow for the HTTP request. I dont see an option to have it automatically generate thereafter.

@ashton.lalchan

ideally you would create a custom connector and give the authentication details there..for that you need to create an external application

then auth would be taken care and you can use the apis

check here on how to do it

cheers

@ashton.lalchan Just add an HTTP Request before your main API call to get a new Bearer token using your client credentials. Store that token in a variable and use it in the Authorization header. If your API call fails with “unauthorized,” fetch a new token and retry. This keeps your calls running even when tokens expire.

@arjun.shiroya theres no option to add that in API workflows in studio

@ashton.lalchan you need to use a separate workflow, a custom connector or manage authentication through an external application/Integration Service. Sorry for any confusion earlier this clarification should help keep your project on the right track.