Forum Discussion
How to fetch Data from API with dynamic access token
Hi Team,
Im new to API/REST API methods in PowerBI. So please help me with understand and how to achieve the below requirement
Im trying to fetch the WebEx meeting informaiton for my analysis from https://webexapis.com/v1/meetings
Our webex support team has given me a document which to follow some steps to get to the actual data. Below are the steps
1. go to https://developer.webex.com and create an integration which provides me client ID, client Secret ID and OAuth Authorization URL. Here is the documentation to for the same https://developer.webex.com/docs/integrations
2. when we enter the OAuth Authorization URL in to the brower and hit enter, we get the code
3. with this code, client ID, client secret id, go to postman and generate the access token
4. this access token is then used to generate the bearer token
5. with the bearer token entered as one of th parameters, we will be able to get to the actual data in Postman
Now, the question is how to do this in powerbi without going to developer.webex.com
Please help me as i have relatively zero knowledge on APIs
4 Replies
- amitchandakSuper User
- AnonymousNot applicable
Hi LP2803 ,
Hope the links could help you a little bit
https://docs.microsoft.com/en-us/power-bi/developer/automation/walkthrough-push-data-get-token
Best Regards,
Eyelyn Qin - shrutivyas06Frequent Visitor
Hello,
You can refer below blog to achieve this functionality-
https://www.advaiya.com/generate-dynamic-token-and-get-data-from-custom-api-in-power-bi/
Regards
Shruti Vyas
- vr_2020Frequent Visitor
shrutivyas06 - I was trying to use this code in Blank Query in Advance editor as per your blog and getting filed token not found. Looks like the API URL for token generation that I am trying to use in the following code seems to be wrong. Can you please help me with one sample API URL format that should be used in url = <<API Url for token generation>>
let
url = <<API Url for token generation>>,
headers = [#"Content-Type" = "application/json"],
postData = Json.FromValue([username="<<User Name>>",
password= "<<Password>>"]),
response = Web.Contents(
url,
[
Headers = headers,
Content = postData
]
),
Data = Json.Document(response),
access_token=Data[token]
in
access_token