Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am trying to connect to a URL; however, I get a credential error. I have passed the Base64 encoded APIKEY and Session TOKEN through the header using the Power Query Advanced Editor, and there are no syntax errors. It then says edit credentials. When I go to choose anonymous it says invalid credentials. If I try the Web API credentials it gives me the error stating I need a API Key named in the header.
Any help would be appreciated.
let
Source = Web.Contents("https://URLHERE", [Headers=[Authorization="Basic Bases64Encode Here="]])
in
Source
V,
I am sorry but I have read the post and still can not figure this out. I am a CPA that took a few C++ courses in college 20 years ago, and spent alot of time developing UI solutions using MS Access and SharePoint as a datawarehouse during that time. I like to think I was doing powerplatform stuff before the powerplatform was branded.
Can you look at the advanced editor screen and point me in the right direction of where I need to code?
I did confirm this is a GET, not POST
I have verified the API_KEY and TOKEN are correct. When encode to Base64 I use the values in the converter like this API_KEYTOKEN. Here is how the content provider describes the headers:
Authentication in header can use Authorization field in following format:
Authorization: Basic {basicHash}
basicHash is base64 encoding of resulting string from: {API_KEY}:{TOKEN}
Example authorization header: $header = ['Authorization : Basic ' . base64_encode(API_KEY . ':' . TOKEN) ];
Should I be encoding the API_KEY and TOKEN differently?
I get invaild credentials when I use API_KEYTOKEN in the base64 converter. But if I add the :, like API_KEY:TOKEN in the converter I get a Bad Request error, so it never passes to the credentials.
I would also take a reccomendation on a developer that can assist. I am a one man shop at the moment but can pay for some help to get this connected.
Hi @TheChilOne ,
If the API method is get, please refer to this blog.
https://blog.crossjoin.co.uk/2014/03/26/working-with-web-services-in-power-query/
If the API method is post, you also need to refer to these:
https://blog.crossjoin.co.uk/2014/04/19/web-services-and-post-requests-in-power-query/
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
8 | |
7 | |
2 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |