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 / Bearer token issue wit...
Power Automate
Unanswered

Bearer token issue with CDS API

(0) ShareShare
ReportReport
Posted on by 8

Hi, 

I have power automate approval flow which will store data in CDS. I have to fetch the data using REST API. For this, i created app in Azure Active Directory and added Dynamic CRM in api permissions. 

Using postman, with Implicit Grant type, i am able to get the token and can see the data present in the table. 

But,when i try to get a token using client secret and password, it is giving me bad request. Can someone help me if i am missing something

Method : POST

Endpoint : https://login.microsoftonline.com/**************/oauth2/token

Headers : Content-Type = application/json

Body : grant_type=client_credentials

           client_id=********

           client_secret=*******

           resource=https://*****.crm4.dynamics.com

 

Below is the response: 

 

{"error":"invalid_request","error_description":"AADSTS900144: The request body must contain the following parameter: 'grant_type'.\r\nTrace ID: f7f03465-9719-47bd-bbf0-dceba2afe201\r\nCorrelation ID: 423cbada-21f9-4d34-985a-5acc37f6ae19\r\nTimestamp: 2020-07-29 11:21:46Z","error_codes":[900144],"timestamp":"2020-07-29 11:21:46Z","trace_id":"f7f03465-9719-47bd-bbf0-dceba2afe201","correlation_id":"423cbada-21f9-4d34-985a-5acc37f6ae19","error_uri":"https://login.microsoftonline.com/error?code=900144"}

 

Screenshot from 2020-07-29 21-10-31.pngScreenshot from 2020-07-29 21-11-41.png

Categories:
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @SaiRupa 

     

    Can you share a screenshot of the flow? 

     

    Can you try passing the body like this in the HTTP action in flow: 

     

    {

    "grant_type"="client_credentials",

    "client_id"="********",

    "client_secret"="*******",

    "resource"="https://*****.crm4.dynamics.com"

    }

     

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

  • SaiRupa Profile Picture
    8 on at

    Hi @Yash

    Sorry for the confusion. I am not using this api in flow. I have a flow for approval process which stores data in CDS. I want to get this data through rest api so that i can display it in my portal. For this first i need to get the token using token endpoint and pass the token to cds web api to get the table data so that i can process this data further as per  my requirement. I am able to get oauth token using my user login but i need to use client secret and key to fetch the token. 

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @SaiRupa 

     

    You might want to check this out once: https://docs.microsoft.com/en-us/graph/auth-v2-user#3-get-a-token

     

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

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 424

#2
11manish Profile Picture

11manish 328 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard