Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi All,
I need to access the data from the POST API provided by the client
can anyone, please help me which option is used for to access the data
Thanks
You cannot pass authorization this way, the only way you can access is through selecting anonymous.
Instead, you must pass any authorization (such as Bearer Token) through the headers argument for web.contents.
In addition, to make it a POST request, you MUST add the argument of Content.
Here is a format I like. Note that i make the headerv and contentv both into JSON format first - this makes it easier to write and to view.
Take note of the argument [Headers = headerv, Content = Json.FromValue(contentv)]. As it is JSON I must convert the contentv using Json.FromValue. In addition, i've called Content-Type as application/json.
I should note, this particular query is to return an access token from OAUTH2. If you have one, you would include the parameter in the headers.
Please don't copy the values, you will need to add the specific arguments to headersv and contentv as required.
headerv = [
#"Content-Type" = "application/json",
#"Accept" = "*/*"
],
contentv = [
#"grant_type" = "client_credentials",
#"client_id" = "{clientid}",
#"client_secret" = "{secret}"
],
Source = (Web.Contents("https://url/oauth2/token", [Headers = headerv, Content = Json.FromValue(contentv)])),
#"Imported JSON" = Json.Document(Source, 1252),
Did I answer your question? Mark my post as a solution! Proud to be a Super User!
Connect with me!
Stay up to date on
Read my blogs on
Thank you for your reply.
I have tried the most such codes before and this one also, but I don't know where is the fault:
What process I have applied in Postman: (Step by Step)
1. I have a URL to get the jwt key value:
https://xxx(client website).azurewebsites.net/dev/auth/user/authenticate
2. Here I have passed the Body contents: (Payload)
{
"TenantId": "Client2",
"UserSignon": "corp2019",
"Password": "test"
}
3. From the second step, I got the "jwt" value shows below
4. I having another URL where I have passed the KEY Name and Key-value generated from 2nd step(jwt)
URL: https://xxx(client website).azurewebsites.net/dev/master-data/departments/get
KeyName: X-Token
Value: jwt generated passed here
5. Then I got the data which I have to access:
I request, can you please send me the code for the same process.
Thanks
Need Token Key?
Well, for me is:
1 - Organizational account if you have one
2 - Web API
3 - Basic
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
27 | |
26 | |
24 | |
13 | |
10 |
User | Count |
---|---|
24 | |
21 | |
20 | |
19 | |
11 |