Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.