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 / Error message " The gr...
Power Automate
Unanswered

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

(0) ShareShare
ReportReport
Posted on 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

Categories:
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    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         

     

  • vnguyen1 Profile Picture
    40 on at

    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

  • Aurelien Profile Picture
    3 on at

    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!

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 426

#2
11manish Profile Picture

11manish 349 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard