Skip to main content
Community site session details

Community site session details

Session Id : 0+UVH+TF7KDNeTuLsCptjz
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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Featured topics

Restore a deleted flow
Loading complete