<?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 Help with API refresh on Power BI Service in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Help-with-API-refresh-on-Power-BI-Service/m-p/1425368#M26064</link>
    <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been given a Power BI file with an API connector that calls a JSON file. The problem is when I upload the file to Power BI Service it won't let me refresh. I get this error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 688px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/373605iBBCBA7E2115B43A2/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How can I update the code to make sure it refreshes on Power BI service?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the code for the data source:&amp;nbsp;&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="code.PNG" style="width: 965px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/373606i383C7CE479146A7F/image-size/large?v=v2&amp;amp;px=999" role="button" title="code.PNG" alt="code.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the code in a text format:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let 
    BaseUrl         = "URL",
    Token           = "TOKEN",
 
    GetJson = (Url) =&amp;gt;
        let Options = [Headers=[ #"Authorization" = "Bearer " &amp;amp; Token ]],
            RawData = Web.Contents(Url, Options),
            Json    = Json.Document(RawData)
        in  Json,
  
    GetPage = (Index) =&amp;gt;
        let Url   = BaseUrl &amp;amp; "&amp;amp;page=" &amp;amp; Text.From(Index),
            Json  = GetJson(Url),
            Value = Json
        in Value,

    PageCount   = 20,
    PageIndices = { 1 .. PageCount },
    Pages       = List.Transform(PageIndices, each GetPage(_)),
    Entities    = List.Union(Pages),
    #"Converted to Table" = Table.FromList(Entities, Splitter.SplitByNothing(), null, null, ExtraValues.Error),&lt;/LI-CODE&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>Sat, 10 Oct 2020 02:53:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-10-10T02:53:08Z</dc:date>
    <item>
      <title>Help with API refresh on Power BI Service</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Help-with-API-refresh-on-Power-BI-Service/m-p/1425368#M26064</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been given a Power BI file with an API connector that calls a JSON file. The problem is when I upload the file to Power BI Service it won't let me refresh. I get this error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 688px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/373605iBBCBA7E2115B43A2/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How can I update the code to make sure it refreshes on Power BI service?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the code for the data source:&amp;nbsp;&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="code.PNG" style="width: 965px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/373606i383C7CE479146A7F/image-size/large?v=v2&amp;amp;px=999" role="button" title="code.PNG" alt="code.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the code in a text format:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let 
    BaseUrl         = "URL",
    Token           = "TOKEN",
 
    GetJson = (Url) =&amp;gt;
        let Options = [Headers=[ #"Authorization" = "Bearer " &amp;amp; Token ]],
            RawData = Web.Contents(Url, Options),
            Json    = Json.Document(RawData)
        in  Json,
  
    GetPage = (Index) =&amp;gt;
        let Url   = BaseUrl &amp;amp; "&amp;amp;page=" &amp;amp; Text.From(Index),
            Json  = GetJson(Url),
            Value = Json
        in Value,

    PageCount   = 20,
    PageIndices = { 1 .. PageCount },
    Pages       = List.Transform(PageIndices, each GetPage(_)),
    Entities    = List.Union(Pages),
    #"Converted to Table" = Table.FromList(Entities, Splitter.SplitByNothing(), null, null, ExtraValues.Error),&lt;/LI-CODE&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>Sat, 10 Oct 2020 02:53:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Help-with-API-refresh-on-Power-BI-Service/m-p/1425368#M26064</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-10T02:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help with API refresh on Power BI Service</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Help-with-API-refresh-on-Power-BI-Service/m-p/1425835#M26067</link>
      <description>&lt;P&gt;Your base URL may be too detailed. Follow this guidance to make it more generic&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blog.crossjoin.co.uk/2016/08/23/web-contents-m-functions-and-dataset-refresh-errors-in-power-bi/" target="_blank"&gt;https://blog.crossjoin.co.uk/2016/08/23/web-contents-m-functions-and-dataset-refresh-errors-in-power-bi/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Oct 2020 18:07:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Help-with-API-refresh-on-Power-BI-Service/m-p/1425835#M26067</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-10-10T18:07:54Z</dc:date>
    </item>
  </channel>
</rss>

