Orchestrato API + Power Automate

Dears,
I’m trying to call use Orchestrator API from Power Automate and I can’t find the right way.
I have Orchestrator on-premise and I see that the authentication is quite different compared to the cloud version.

From the docs ( Using OAuth for External Apps (uipath.com) I see the below steps:

  • Register an external application: What’s the Redirect URL to enter when working with Power Automate?? I’m using https://oauth.pstmn.io/v1/callback

  • Send a POST request as described in the doc: When running from postman I get the error “error”: “unauthorized_client”

If I send the above request from Power Automate I get the error Http request failed with status code ‘NameResolutionFailure’ and status message: ‘The remote name could not be resolved: ‘orchestrator url’’

Do you have any idea on how to properly send HTTP requests?

Hi @alessio.giovannini

Please check this. First from Postman if you are able to make the request then that can be replicated in power automate by changing the redirect url

Check this

cheers

Link no 1 : It’s about Authorization Code and, as per documentation: “Use this grant type when the registered application is of the type confidential and the request is for user scope.”
Which is not what I want, because mine is an application scope.

Link no 2 : The answer marked as ‘Solution’ points to the Orchestrato documentation which I already followed and explains to create an external application and call the earlier mentioned request.

My main concern is about PowerAutomate, is there someone who managed to connect these two applications for real?

1 Like

Hi @alessio.giovannini

We are using power automate trigger and can you confirm what redirect url you are using and how you are trying to connect.

And I gave you the above links because I see even with postman you are getting errors.

cheers

From Postman the error was there because in the external application settings you also need to add the application scope and not only the user one.
Now I’m able to get the access_token but as soon as I try to run a job I receive some CORS configuration error.

My main goal is to trigger it from PowerAutomate btw, my redirect link is https://oauth.pstmn.io/v1/callback

Hi @alessio.giovannini

To start with the redirect url you are using is for post man.

for power automate you have to use the url corresponding to that site. Redirect url is the way Oauth2.0 sends the token back.

Try this

image

This might be different as per your power automate setup but sure the postman url would not work here

cheers

Check these articles:

https://uipath-survey.secure.force.com/CaseView/articles/Knowledge/How-to-use-UiPath-External-Application-with-Application-Scopes-in-Power-Automate?lang=en_US
https://uipath-survey.secure.force.com/CaseView/articles/Knowledge/How-to-use-UiPath-External-Application-with-User-Scopes-in-Power-Automate?lang=en_US

Thanks Marian, looks exactly what I did except for the redirect url which was not entered in case of application scopes.
Unfortunately it didn’t solve the issue, I still get the error UnresolvableHostName . Http request failed with status code ‘NameResolutionFailure’ and status message: ‘The remote name could not be resolved: ‘orchestrator********.com’’.
I suppose CORS settings should allow PA server… Something for my IT admin…

This is something related to your Gateway.

Check internally with your network team.

Power Automate connects from outside of your network, so the endpoint (your Orchestrator) must be reachable from over the internet.

Thanks a lot Marian for your support!

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