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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get token from Rest AP...
Power Automate
Unanswered

Get token from Rest API with Flow

(0) ShareShare
ReportReport
Posted on by 1,430 Super User 2024 Season 1

Hi,

 

I am going out of my mind with this one... and could really use some help!

I need to connect to an API and get a bearer token to then proceed with following calls.

I got it all working on Postman and I also can make GET and POST calls with flow, provided I get the token in Postman first.

 

So, my flows which already have the bearer token on authorization work and I know I can connect to the API and get the data I need.

 

My problem is I can´t get flow to fetch my token.

 

Here's what I have:

URI:

http://someURLt:somePort/webapi/token

 

Header: 

{
"Content-Type": "application/x-www-form-urlencoded",
"Accept": "application/json"
}

 

Body:

{
"grant_type": "password",
"username": "someUser",
"password": "somePassword",
"someAdditionalRequiredParameter": "someValue",
"someAdditionalRequiredParameter": "someValue",
"someAdditionalRequiredParameter": "someValue"
}

 

The result: {"error":"unsupported_grant_type"}

 

I have search the forums and other channels and I still haven´t found a solution for this. Has anyone encountered this before?

 

Best regards.

Categories:
  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    Quick update. I got it to work. Changed the body to:

     

    key=value&key=value

     

    Best regards.

  • leumas09 Profile Picture
    45 on at

    Hi Daniel, thank you very much ! I was struggling with this

  • crowdjs Profile Picture
    133 on at

    Here is how I had to do it. Had to add the parameters in to the Queries portion and not in the Headers.

    Screenshot 2020-11-25 140559 - Copy.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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 299

#2
11manish Profile Picture

11manish 274 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard