Require guidance in Orchestrator API

Hi all,

As I am very new to Orchestrator API, I have started from the scratch of logging in the orchestrator using HTTP Request wizard, where I get “result” - (Authentication token) in response JSON. As per Orchestrator API Guide, we need to use auth token for future requests. Here I have set of questions,

  1. Should I need to use another HTTP Request activity for another request (say to check my Timing Zone or any other requests) ?

PROBLEM : Whenever I request for robot/asset details, it responds an error message as “You are not authenticated (sign in) to perform this operation”

  1. How should I use the auth token in future requests that I have got in (“https://XYZ.com/api/account/authenticate”) request ?

It would be very helpful if anyone come up with sample workflow that meets my requirement
Thanks in advance :slightly_smiling_face:

Happy Automating ! :wink:
Dominic

4 Likes

Hi - were you able to get a response somewhere else on this topic? I am facing the same issue. thanks

Hi @rgm_cr,

Hope this solution might help you !

TEST_ORCHESTRATOR_API.zip (15.8 KB)

Thanks and Regards,
Dominic Arul Collins V

6 Likes

thanks a lot. this really helps… will you be able to give me some inputs on processing queuitems using API with specific reference ID

@lawanyaram, It was @Susana who helped me with this solution ! May I know what you need to do with queue Items (like Add, Delete…) ?

Regards,
Dominic :slight_smile:

1 Like

i want to process specific queue item which matches my filter… currently when we use get transaction item it marks as in progress … then only we will be able to see the values
if my filter is not matching then i want the status to remain in new
example i am trying to get all items with specific reference ID and manipulate it

Hi @lawanyaram, GET from following URL
https://OrchestratorURL/odata/QueueItems?$filter=QueueDefinitionName eq ‘Queue Name’ and Status eq UiPath.Core.Model.Queues.ProcessingStatus%27New%27

From JsonObject it returns, extract the data of queue as follow,
JArray = Jobject(“value”).Value

Make your filter here and store the queue IDs you want into a collection.

Regards,
Dominic :slight_smile:

Small note, QueueDefinitionName property is not available anymore from 2017.1 version of Orchestrator, however, you can identify queue using property QueueDefinitionId.

QueueDefinitionId can be retrieve using */odata/QueueDefinitions ressource, looking for name there first.

Cheers

@Florent_Salendres, Thanks for the update ! I dint know that :slight_smile:

Regards,
Dominic :slight_smile:

Hi

I have tried your example project and the authentication section works fine and returns an authorization key but the subsequent sections fail with this error

{“Result”:null,“TargetUrl”:null,“Success”:false,“Error”:{“Code”:0,“Message”:“You are not authenticated!”,“Details”:“You should be authenticated (sign in) in order to perform this operation.”,“ValidationErrors”:null},“UnAuthorizedRequest”:true,“__abp”:true}

Do you have any tips for troubleshooting this?

Cheers
David

@david.spriggs, Ensure that you have added authentication token in the specified format Bearer : Auth Token in all your future requests.

Regards,
Dominic :slight_smile:

Thanks @Dominic this is what the value is set in the project

image

Which at runtime is:

Bearer ZI1BJOR4OhLYE97PvHAHVHwbrmHaK5sWmTukZ4Uo-ZuzoY3fKX5j1ybTDzj56PmOw0TcZMKpfSem-nf4Y5mAZJSsX8UfqwHl3PG7dk7yLdWy5DVUHoSAuYqOc_zxccY5SIfI-NmseWwF0JySQ_YBwe7vy0sk5q44MY5SlUA8JlI-KVNxxdC19nUuBqkUL-TtIJ-a10h4Zus79PKhdOXqLC-93jF1AAeGR0ecCbxmSXkXJz6hHDxsRbsUv-QK5F7m0ZTPUXZLuopJuvUIeBTZR72PyZGbDSQzuHHgPygtvS7D-sD1EpUrifVC5_v7urPp0X-3Hoj_fcgGxeI_UgwNWcJvWb18OaI9krPXrWjOVdJphSxjiXvVQaTtUmG0n0EnCOIs0yohkWnaUkIyU-UH5T1n6F-tx1pPlEjk4vUnWxjFJiVlreDYOZJ91fn5em2AuVVN6GZdMywBHvlt6LTJEFIJYqa-F_aypREsFCvz7Rw_q1UvRRs8cBRjHb8CcwPvnl1IcQ

Does the project you uploaded still work fine for you I have only populated the variables with my tenancy and credentials?

Cheers

David

1 Like

I’m getting the same error on Get Robots and Start Job.
When I add the Access Token I get this error: GetRobots : Assign AccessToken : Object reference not set to an instance of an object.

Any ideas?
Thanks!

I’m working on most of it. I think now I’m to the point of my startInfo.json file is not correct.

Thanks!