web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Using 'HTTP Request' a...
Power Automate
Answered

Using 'HTTP Request' activity to get OAuth token

(0) ShareShare
ReportReport
Posted on by 74

Hey Community, 

 

I'm trying to us the 'HTTP Request' Activity to get a OAuth token from the endpoint https://cloud.uipath.com/identity_/connect/token.

The body for the POST request has been tested in other environments and works just fine there, but when im using PA im getting the error "Invalid Client". My best guess is, that the error is related to the syntax and I'm hoping that one of you can help me out.

 

Screenshot 2021-06-10 153341.png

Categories:
I have the same question (0)
  • Gopala_Krishna Profile Picture
    1,495 on at

    @FelixRech 

    I tried checking the documentation related to the UIPath API and here's something that I found which might be useful for you.

    Using OAuth for External Apps (uipath.com)

     

    As per the above documentation it seems that you are missing the code:"Authorization code" in the body. The sample body for the post request to the end point https://{Orchestrator_URL}/identity/connect/token looks as below

    { grant_type: "authorization_code" code: "{authorization_code}" redirect_uri: "{redirect_url}" client_id: "{app_id}" client_secret: "{app_secret}" }

     

    The body that you have used is for another end point https://{Orchestrator_URL}/identity/connect/authorize which is a identity server authorization endpoint, please try to go through the documentation for more information.

     

    -------------------------------------------------------------------------------------------------------------------------------------

    If the information shared helps, please consider giving a thumbs up 👍 and mark solution as resolved

     

  • FelixRech Profile Picture
    74 on at

    Hello @Gopala_Krishna

     

    thank you for the kind answer. I'm familiar with this documentation of course. I think your not looking at the correct documentation yet. Since I'm trying to connect to the could orchestrator, I'm refering to this documentation: https://docs.uipath.com/automation-cloud/docs/setting-up-the-external-application

     

    I'm using this body because I've set Power Automate as an confidential application in an application Scope (second option in the first table)

     

    FelixRech_0-1623335238710.png

    Following the link, I'm forwarded to this part of the documentation:

    FelixRech_1-1623336019430.png

     

    As mentioned in the original post, this combination of endpoint and parameters works just fine when executing it in python for example.

     

    Kind regards 

     

  • Verified answer
    FelixRech Profile Picture
    74 on at

    I found the solution to my problem with a bit of luck and trial and error. This is how the body should look like: Screenshot 2021-06-10 175047.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard