Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello All,
I am having trouble getting an access token using an API Post method in API, can some one please help me to convert the below mentioned cURL to Power BI compatible query ?
curl -i -X POST \
-H "Content-Type:application/x-www-form-urlencoded" \
-H "Authorization:Basic AbcDewsgR" \
'https://oauth.brightcove.com/v4/access_token?grant_type=client_credentials'
Thank you
Hi @amitchandak ,
I guess I wasn't clear on my request, I am trying to create an API POST request to get Access Token from brightcove API so that I can use this token to make an GET request using the token received from the above POST API call. Attached is the screenshot of the POST request for your reference. Can you please let me know how do I do this in Power BI ?
cURL code for the below request is :
curl -i -X POST \
-H "Content-Type:application/x-www-form-urlencoded" \
-H "Authorization:Basic AbcdfRtwSrte" \
'https://oauth.brightcove.com/v4/access_token?grant_type=client_credentials'
I tried to convert the above cURL and below is the query but this gives me an error,
let
Source = Json.Document(Web.Contents(
"https://oauth.brightcove.com/v4/access_token?grant_type=client_credentials",
[
Query=[grant_type="client_credentials"],
Headers=[#"Content-Type" = "application/x-www-form-urlencoded", #"Authorization" = "Basic AbcdfRtwSrte"]
])),
items=Source[items]
in
items
Error Message :
DataSource.Error: Web.Contents failed to get contents from 'https://oauth.brightcove.com/v4/access_token?grant_type=client_credentials' (404): Not Found
Details:
DataSourceKind=Web
DataSourcePath=https://oauth.brightcove.com/v4/access_token
Url=https://oauth.brightcove.com/v4/access_token?grant_type=client_credentials
Hi @Anonymous ,
Try to modify your query as below:
let
Source = Json.Document(Web.Contents(
"https://oauth.brightcove.com/v4/access_token",
[
Query=[grant_type="client_credentials"],
Headers=[#"Content-Type" = "application/x-www-form-urlencoded", #"Authorization" = "Basic AbcdfRtwSrte"]
])),
items=Source[items]
in
items
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 50 | |
| 44 | |
| 41 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 68 | |
| 32 | |
| 32 | |
| 32 |