<?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 Re: Using a REST API as a data source - Web.Contents Content option connecting anonymously in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Using-a-REST-API-as-a-data-source-Web-Contents-Content-option/m-p/290157#M8520</link>
    <description>&lt;P&gt;could you please post your code in here?&lt;BR /&gt;I am having trouble with anonymous credentials, it seems my header is not correctly pushing username and password values...&lt;/P&gt;</description>
    <pubDate>Wed, 25 Oct 2017 18:33:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-10-25T18:33:04Z</dc:date>
    <item>
      <title>Using a REST API as a data source - Web.Contents Content option connecting anonymously</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-a-REST-API-as-a-data-source-Web-Contents-Content-option/m-p/115524#M4041</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have another post on the community, which has been partially answered, but not resolved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Integrations-with-Files-and/M-Query-to-use-POST-method-on-a-Web-API/m-p/115354#M7774" target="_blank"&gt;http://community.powerbi.com/t5/Integrations-with-Files-and/M-Query-to-use-POST-method-on-a-Web-API/m-p/115354#M7774&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a Web data source connecting to the Sage One API. Im using a POST method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tested the URL, headers, content-type and content on Postman.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And they work fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When trying to connect via Power BI Desktop I get this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;DataSource.Error: Web.Contents with the Content option is only supported when connecting anonymously.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;Details:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataSourceKind=Web&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataSourcePath=&lt;A href="https://accounting.sageone.co.za/api/1.1.2/AccountBalance/Get" target="_blank"&gt;https://accounting.sageone.co.za/api/1.1.2/AccountBalance/Get&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;This is the code I'm using, I have tried with authorisation in the header and setting it separately in the poppup and data source settings:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;body=&lt;BR /&gt;"{&lt;BR /&gt;&amp;nbsp; ""FromDate"": ""2017-01-01"",&lt;BR /&gt;&amp;nbsp; ""ToDate"": ""2018-01-01""&lt;BR /&gt;}",&lt;BR /&gt;url = "&lt;A href="https://accounting.sageone.co.za/api/1.1.2/AccountBalance/Get?ApiKey={GUIDGUID}&amp;amp;CompanyId=123456" target="_blank"&gt;https://accounting.sageone.co.za/api/1.1.2/AccountBalance/Get?ApiKey={GUIDGUID}&amp;amp;CompanyId=123456&lt;/A&gt;",&lt;/P&gt;&lt;P&gt;Source = Json.Document(Web.Contents(url, [ Headers = [#"Content-Type"="application/json"], Content = body] ))&lt;BR /&gt;in Source&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have seen a few posts relating to this error but none with a solution that would work for this scenario.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you check this isnt a Power BI bug...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Digiroo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2017 01:52:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-a-REST-API-as-a-data-source-Web-Contents-Content-option/m-p/115524#M4041</guid>
      <dc:creator>digiroo</dc:creator>
      <dc:date>2017-01-19T01:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using a REST API as a data source - Web.Contents Content option connecting anonymously</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-a-REST-API-as-a-data-source-Web-Contents-Content-option/m-p/115650#M4042</link>
      <description>&lt;P&gt;Hi This has been resolved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am setting the Basic Authorisation in the header and setting credentials to Anonymous and it works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the patch today has fixed &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Digiroo&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2017 06:46:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-a-REST-API-as-a-data-source-Web-Contents-Content-option/m-p/115650#M4042</guid>
      <dc:creator>digiroo</dc:creator>
      <dc:date>2017-01-19T06:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using a REST API as a data source - Web.Contents Content option connecting anonymously</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-a-REST-API-as-a-data-source-Web-Contents-Content-option/m-p/290157#M8520</link>
      <description>&lt;P&gt;could you please post your code in here?&lt;BR /&gt;I am having trouble with anonymous credentials, it seems my header is not correctly pushing username and password values...&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 18:33:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-a-REST-API-as-a-data-source-Web-Contents-Content-option/m-p/290157#M8520</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-25T18:33:04Z</dc:date>
    </item>
  </channel>
</rss>

