How to get the output of an API triggered Robot as a Response in postman

Can Any one please help me for a activity that helps to show the output returned by the bot to an API response.
I am calling an API - to trigger bot from postman. (https://cloud.uipath.com/rpasebenhayi/DefaultTenant/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs)
In the response body I need the output that is returned by the bot by screen scrapping.

Please let me know the process so that i can achieve it.

That API cannot do that, the response is about if the job was created, not if it was completed, the response would time out if it needed to wait for the job to be complete.

You need to create the job, grab the key from the returned values and then use something like
https://cloud.uipath.com/rpasebenhayi/DefaultTenant/orchestrator_/odata/Jobs({{key}}) to grab the job output once the job is completed.

Thanks for the reply Jon.
So I need to call 2 API for the same . Can it be possible for a single API Call That the bot triggers and return a response as the output so I can store in my DB the data which is scrapped.

No, think of it logically.

You make a API to make the Job, that job may take an hour to start because there are no licences available, the API call cannot be waiting for a response for that long. Even if the job can start immediately it still wont finish for maybe a minute, the API needs to provide a response immediately.

The second call just gets the status of the Job, if you do it immediately after creating it then it will likely be ‘pending’ and you still cannot get the output, you need to keep checking it until the status is ‘Complete’

Can u suggest an activity in Studio so that the bot Calls an API and return a response as output. Is it possible to do so?

I have a code in power automate that triggers the bot and in the same API it returns the output values

Have you tried using Http Request activity? HTTP Request

Hi Dawid ,
In the http request can we add parameters so that we can get an response that contains the output produced by the bot?

yes you can. U have to go to Http request properties and in Response content → give it your variable to store output. It depend on the output u wanted e.g JSON, XML. Then later you have to use Deserialize XML/JSON if you want to get parts of data from it.

here an example. I’m not sure if this is what you want to do or not. Hope this help
get Currency xml.xaml (11.5 KB)

Just to be clear, you want to use the API from an external process NOT a robot?

You would instantiate the job using an API.
You would consume the outcome of the job using the GET equivalent, having the data passed back out as an argument.

To do the ‘the robot has finished’ part you might be able to use webhooks but it’d be ugly.

Would suggest having the RPA process generate a service bus (if azure) message which would automatically trigger the follow on job.

Otherwise yeah, you’ll have the potential for a service waiting up to 24hours for a response like Jon suggested.