<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic First time API connection - Base64 Encoded in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/First-time-API-connection-Base64-Encoded/m-p/1588534#M27146</link>
    <description>&lt;P&gt;I am trying to connect to a URL; however, I get a credential error.&amp;nbsp; 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.&amp;nbsp; It then says edit credentials.&amp;nbsp; When I go to choose anonymous it says invalid credentials.&amp;nbsp; If I try the Web API credentials it gives me the error stating I need a API Key named in the header.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;Source = Web.Contents("https://&lt;FONT color="#0000FF"&gt;URLHERE&lt;/FONT&gt;", [Headers=[Authorization="Basic &lt;FONT color="#0000FF"&gt;Bases64Encode Here&lt;/FONT&gt;="]])&lt;BR /&gt;in&lt;BR /&gt;Source&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="community question.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/429133i34C87B17BEAA6115/image-size/medium?v=v2&amp;amp;px=400" role="button" title="community question.png" alt="community question.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 09 Jan 2021 14:41:55 GMT</pubDate>
    <dc:creator>TheChilOne</dc:creator>
    <dc:date>2021-01-09T14:41:55Z</dc:date>
    <item>
      <title>First time API connection - Base64 Encoded</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/First-time-API-connection-Base64-Encoded/m-p/1588534#M27146</link>
      <description>&lt;P&gt;I am trying to connect to a URL; however, I get a credential error.&amp;nbsp; 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.&amp;nbsp; It then says edit credentials.&amp;nbsp; When I go to choose anonymous it says invalid credentials.&amp;nbsp; If I try the Web API credentials it gives me the error stating I need a API Key named in the header.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;Source = Web.Contents("https://&lt;FONT color="#0000FF"&gt;URLHERE&lt;/FONT&gt;", [Headers=[Authorization="Basic &lt;FONT color="#0000FF"&gt;Bases64Encode Here&lt;/FONT&gt;="]])&lt;BR /&gt;in&lt;BR /&gt;Source&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="community question.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/429133i34C87B17BEAA6115/image-size/medium?v=v2&amp;amp;px=400" role="button" title="community question.png" alt="community question.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2021 14:41:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/First-time-API-connection-Base64-Encoded/m-p/1588534#M27146</guid>
      <dc:creator>TheChilOne</dc:creator>
      <dc:date>2021-01-09T14:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: First time API connection - Base64 Encoded</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/First-time-API-connection-Base64-Encoded/m-p/1589300#M27162</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/279209"&gt;@TheChilOne&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the API method is get, please refer to this blog.&lt;/P&gt;&lt;P&gt;&lt;A href="https://blog.crossjoin.co.uk/2014/03/26/working-with-web-services-in-power-query/" target="_self"&gt;https://blog.crossjoin.co.uk/2014/03/26/working-with-web-services-in-power-query/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the API method is post, you also need to refer to these:&lt;/P&gt;&lt;P&gt;&lt;A href="https://blog.crossjoin.co.uk/2014/04/19/web-services-and-post-requests-in-power-query/" target="_self"&gt;https://blog.crossjoin.co.uk/2014/04/19/web-services-and-post-requests-in-power-query/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://social.msdn.microsoft.com/Forums/en-US/029fed1d-56fe-476a-9d7d-f367c5036b6e/posting-xml-to-a-restful-service?forum=dataexplorer" target="_self"&gt;https://social.msdn.microsoft.com/Forums/en-US/029fed1d-56fe-476a-9d7d-f367c5036b6e/posting-xml-to-a-restful-service?forum=dataexplorer&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Liang&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 06:37:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/First-time-API-connection-Base64-Encoded/m-p/1589300#M27162</guid>
      <dc:creator>V-lianl-msft</dc:creator>
      <dc:date>2021-01-11T06:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: First time API connection - Base64 Encoded</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/First-time-API-connection-Base64-Encoded/m-p/1592466#M27200</link>
      <description>&lt;P&gt;V,&lt;/P&gt;&lt;P&gt;I am sorry but I have read the post and still can not figure this out.&amp;nbsp; 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.&amp;nbsp; I like to think I was doing powerplatform stuff before the powerplatform was branded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you look at the advanced editor screen and point me in the right direction of where I need to code?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;I did confirm this is a GET, not POST&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have verified the API_KEY and TOKEN are correct.&amp;nbsp; When encode to Base64 I use the values in the converter like this API_KEYTOKEN.&amp;nbsp; Here is how the content provider describes the headers:&lt;/P&gt;&lt;P&gt;Authentication in header can use Authorization field in following format:&lt;BR /&gt;Authorization: Basic {basicHash}&lt;BR /&gt;basicHash is base64 encoding of resulting string from: {API_KEY}:{TOKEN}&lt;BR /&gt;Example authorization header: $header = ['Authorization : Basic ' . base64_encode(API_KEY . ':' . TOKEN) ];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I be encoding the API_KEY and TOKEN differently?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get invaild credentials when I use API_KEYTOKEN in the base64 converter.&amp;nbsp; 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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would also take a reccomendation on a developer that can assist.&amp;nbsp; I am a one man shop at the moment but can pay for some help to get this connected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="community question 2.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/429738iDCB261C3F188085B/image-size/large?v=v2&amp;amp;px=999" role="button" title="community question 2.png" alt="community question 2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 12:44:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/First-time-API-connection-Base64-Encoded/m-p/1592466#M27200</guid>
      <dc:creator>TheChilOne</dc:creator>
      <dc:date>2021-01-12T12:44:35Z</dc:date>
    </item>
  </channel>
</rss>

