Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi All,
I have issue in getting data from web api . I got the url and Api key from client . In Postman iam passing the url with header as API key and key value. But In Power BI , under http request parameter i cant find api key . I cant simply pass the url as it says access is forbidden . so i manually given the API KEY and value , but it says apikey works only with anonymous access .
iam not sure how to move ahead. please help me to get out of this
I know this reply is very late lol. Since the Mailchimp service pack was deprecated, you would have to look for another way. As a workaround, maybe you can use a 3rd party connector, it can save you a lot of time compared to other options. I've tried windsor.ai, supermetrics (which doesn't have PBI as a destination, so you first have to export to Google Sheets and then export to PBI) and funnel.io. I stayed with windsor because it is much cheaper so just to let you know other options. In case you wonder, to make the connection first search for the Mailchimp connector in the data sources list:
After that, you will have to first create a secret API key in your Mailchimp account and then using your credentials add your account to the platform.
Once you’ve done this, you can proceed and go to the “Preview and destination” step
There just select the fields you need. Finally, just select PBI as your data destination and finally just copy and paste the url on PBI --> Get Data --> Web --> Paste the url.
Hi @vamshikrishna20 ,
By using an Azure Function Proxy it is possible to bypass the Power BI restriction of not being able to do anonymous authentication on Web data sources that require an API key.
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
You haven't said what API you are trying to access or if you have checked the API documentation which should tell you how to connect to it and get data.
Another way to make the query is this
let
api_url = "https://api.com",
ClientID = "",
apikey = "YOUR-API-KEY",
EncodedCredentials = "Basic " & Binary.ToText(Text.ToBinary(ClientID & ":" & apikey), BinaryEncoding.Base64),
data= Json.Document(Web.Contents(api_url,
[
Headers = [#"Authorization"=EncodedCredentials]
]
)
)
in
data
This format works with an API like Mailchimp that only provides an API key.
Regards
Phil
Proud to be a Super User!
How does the API specify that you use the API Key to connect to it? I don't know, the API documentation should tell you.
How did you get the API Key?
Regards
Phil
Proud to be a Super User!
What API are you trying to access?
You probably need to pass the username/password/api key as part of the request headers. I don't know exactly how your API requires this or what you mean by an API Key but I've seen API's where the API Key is passed as the Username and the Password is left blank.
Try this code and leave the Password as ""
Enter your API Key as the Username and enter the correct URL to the API
Username = "xxxxxxxx",
Password = "",
api_url = "https://api.com/",
EncodedCredentials = "Basic " & Binary.ToText(Text.ToBinary(Username & ":" & Password ), BinaryEncoding.Base64),
Token_Response = Json.Document(Web.Contents(api_url,
[
Headers = [#"Content-Type"="application/x-www-form-urlencoded",#"Authorization"=EncodedCredentials],
Content=Text.ToBinary("grant_type=client_credentials")
]
)
)
Regards
Phil
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |