cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jcfDaniel
Frequent Visitor

Get token from Rest API with Flow

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.

3 REPLIES 3
jcfDaniel
Frequent Visitor

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

 

key=value&key=value

 

Best regards.

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

crowdjs
Resolver I
Resolver I

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

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (72,512)