Skip to main content

Notifications

Community site session details

Community site session details

Session Id : aO904kX/Mwh2ZlqhD1OnlO
Power Automate - Using Flows
Unanswered

Error message " The grant type was not specified in the request" while trying to get the access token using POST method in flow

Like (0) ShareShare
ReportReport
Posted on 17 Jul 2019 17:17:51 by 40

I am using Post method try to get the access token thru Oauth 2.

URI:https://apiv2.webdamdb.com/oauth2/token.php

Body :

grant_types=@{variables('grant_type')}&client_id=@{variables('client_id')}&client_secret=@{variables('client_secret')}&username=@{variables('username')}&password=@{variables('pw')}

 

and got the error messsage below

{
  "error": "invalid_request",
  "error_description": "The grant type was not specified in the request"
}

 

any suggestion ? Thanks

Note: i was able to run this in Postman without any issue

  • Aurelien Profile Picture
    3 on 24 Oct 2019 at 08:51:58
    Re: Error message " The grant type was not specified in the request" while trying to get the access token using POST method in flow

    Hello,

     

    I got the same problem. After hours and hours of headache: the body must be JSON formated...

     

    From


    Body :

    grant_types=@{variables('grant_type')}&client_id=@{variables('client_id')}&client_secret=@{variables('client_secret')}&username=@{variables('username')}&password=@{variables('pw')}

    To

    {
    "grant_types":@{variables('grant_type')},
    "client_id":@{variables('client_id')},
    "client_secret":@{variables('client_secret')},
    "username":@{variables('username')},
    "password":@{variables('pw')}
    }

    Maybe you will have to add double quotes arround your values, but anyway, this is the solution.

     

    Regards!

  • vnguyen1 Profile Picture
    40 on 18 Jul 2019 at 15:22:13
    Re: Error message " The grant type was not specified in the request" while trying to get the access token using POST method in flow

    hi @v-yamao-msft , thanks for your response

    the grant_type=password that is how i define in here. i tried to put grant_type in headers, body ,... it still the same error message. In Postman, it put grant_type=password in body. it works fine. i did establish the other connection using Oauth 2 with grant_type=client_credentials in FLOW; it works completely fine. Not sure why i keep getting the error message. any suggesstion ? Thanks

  • v-yamao-msft Profile Picture
    on 18 Jul 2019 at 05:45:28
    Re: Error message " The grant type was not specified in the request" while trying to get the access token using POST method in flow

    Hi @vnguyen1 ,

     

    The error message says that the grant type was not specified in the request.

     

    From the info you provided, a variable is used for the grant_type. How is the variable configured?

     

    From the following doc we know that, to request an access token, the grant_type should be authorization_code for the authorization code flow.

     

    Please make sure you have specified the grant type properly.

     

    Here is the link of the doc:

    https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow

     

    Best regards,

    Mabel         

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,658 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow
Loading started
Loading complete