UIPATH Orchestrator API NOT Cloud

Hola a todos necesito saber como utilizar las api para orchestrator, ya me lei muchisimos posts acerca de como usar las apis pero no termino de entenderlo.
Todo esto porque quisiera actualizar Assets desde un workflow como sea no se bien como darle la vuelta a todo ese asunto de cloud api y on-premise, esto es lo más lejos que llegue:
image
con ese access_token intente usar una api para traer todos los assets pero siempre me marca que no estoy autorizado.
Estoy usando Orchestrator on-premise.
Alguien que me pueda ayudar a salir de este problema?

1 Like

Hola, para autenticarte debes seguir los siguientes pasos:

  1. Realice una solicitud POST para api/ account/authenticate pasando el siguiente JSON en el cuerpo de la solicitud:
    {
    “tenancyName”: “string”,
    “usernameOrEmailAddress”: “string”,
    “password”: “string”
    }

Si no ha establecido Tenancy, use “Default”. Esta solicitud debe devolverle un token.

Para realizar cualquier otra solicitud, deberá pasar el Header como “Authorization: Bearer + token”.

Para ver todos los métodos disponibles, visite: orchestratorlink/Swagger/ui/index#/.

Nota: utilicé el traductor de google, perdón si algo se deletrea mal.

Espero que te sirva de ayuda.

pero si quieres hacer esto dentro de un proceso, puedes usar la actividad Set Asset…

I tried using this links https://platform.uipath.com/api/account/authenticate or MyOrchestrator.com/api/account/authenticate with this body:

{
“tenancyName” : “Default”,
“usernameOrEmailAddress” : “My Email Access”,
“password” : “My password”
}

And I get in both cases that my credentials are incorrect. right now i’m confused because i was using this credential to log in into my orchestrator page (on premise)

So, in the first page of orchestrator you should see this:

Make sure to click on you tenancy, circuled in blue. This will open another page that is your orchestrator page, like this one:

Use the URL from the last image, that should be something like UiPath(circuled in blue)/api/Account/Authenticate

This should be enough.

Hola,

Tiene que ser con APIs? es que ya hay comandos en UiPath para interactuar con el Orchestrator, incluso hay una plantilla ya con los comandos/dependencias (Orchestration Process)

this is using the cloud api right?
I’m using the on premise orchestrator

Correcto, no me explique bien hace un momento, pero necesita actualizar los assets desde una aplicación externa

I thought that you need to use API as mandatory. There is an activity called “Set Asset” that you could use to change the asset value in orchestrator. As @bcorrea mentioned before.

Sorry I didn’t explain myself well, I want to use the apis with an external application, so I need to use it.
Maybe there is no way to do that on-premise orchestrators, we are not using cloud so still stuck.
Thank you for all the replies guys. :pray:

Can you try one last thing? I use API and my orchestrator is on premises as well, so i can tell you it works. hahaha.

Check if you can do the following:

Go to your orchestrator, log in it and try to access orclink/swagger/ui/index#/ this will give all the methods available.

If you go to orclink/odata/Jobs, you should be abble see the JSON of all jobs in screen. You need to be logged in.

Can you try and see if it works?

yes I can access to swagger from my on premise orchestrator I see all the methods available

Well, look, When I try to use api/Account/Authenticate from postman i receive the code 400 Empty or invalid inti forgery header token, but from swagger it works, can you explain me why?
anyways, the [> "result": lot of stuff] is the token?

Well, if you can do it via swagger, that is right way. So, lets move on.

Yes, the “lot of stuff” is your token. Now that you have the token you can make any other request, you just need to pass in the Header: “Authorization: Bearer youtoken”, try to make others requests via swagger.

There are two motives why you cant get access via postman:

  • Your orchestrator doesn’t have a valid certified (not using HTTPS), this was the cause of my problem when i first try to use API.

  • You orchestrator is not available outside of internal network, this should be linked with first motive.

Any of these topics applies to your case?

1 Like

Yes, the certificate is not valid in my orchestrator page, it means I’ll not able to access from outside unless i use swagger page?
what can I do in this situation?

1 Like

If i’m not mistaken, the only way that i know is to apply a valid certificate to the orchestrator site. Otherwise, you shouldn’t be able to make HTTPS requests.

Well I think this is the end of the line for me, I appreciate you help Schirru, Now I need to talk with infrastructure department to apply a valid certificate.
Can I contact with you direct message when I fix that?

1 Like

I guess there is really nothing you can do more with the API until you get the certificate.

Happy that i could help you! Sure, i’ll be happy to help!

1 Like

What is your external application? I guess it is in there that you can override the need for the certificate.