<?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 How do I solve user API credentials in a report? in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/How-do-I-solve-user-API-credentials-in-a-report/m-p/950781#M22510</link>
    <description>&lt;P&gt;I´m doing a Power Bi report that use data from a API. I have done a table with the credentials to the API, username, password and subscriptionkey. The first question to all tables with data is to get the token from the API so I can ask the question correct. Looks like this in my table and the advanced editor:&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;Url = Text.Format("&lt;A href="https://api.hey.com/fun/authentication/login?username=#{0}&amp;amp;password=#{1}&amp;quot;,{#&amp;quot;UserIdFile" target="_blank" rel="noopener"&gt;https://api.hey.com/fun/authentication/login?username=#{0}&amp;amp;password=#{1}",{#"UserIdFile&lt;/A&gt;", Uri.EscapeDataString(#"PasswordFile")}),&lt;BR /&gt;TokenSource = Json.Document(Web.Contents(Url, [Headers=[#"Ocp-Apim-Subscription-Key"=SubscriptionKey]])),&lt;BR /&gt;userCode = TokenSource[userCode],&lt;BR /&gt;Ask = Text.Format("&lt;A href="https://api.hey.com/fun/v1/machines/#{0}/history/utilization?start=#{1}&amp;amp;end=#{2}&amp;amp;expand=1" target="_blank" rel="noopener"&gt;https://api.hey.com/fun/v1/machines/#{0}/history/utilization?start=#{1}&amp;amp;end=#{2}&amp;amp;expand=1&lt;/A&gt;", {#"MachineId", #"startDate", #"endDate"}),&lt;BR /&gt;Source = Json.Document(Web.Contents(Ask, [Headers=[#"X-Auth-Token"=userCode, #"Ocp-Apim-Subscription-Key"=SubscriptionKey]])),&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;My table with the credentials looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="creds.JPG" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/240334i9DDC36376F6AE9F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="creds.JPG" alt="creds.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;One row with my username, password and sub key.&lt;/P&gt;&lt;P&gt;When I refresh the reports everything works fine and I get new data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But now the tricky part starts &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My user of this reports when I publish them need to be able to update the credentials with their own ones.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I solve that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked into using PowerApps with edit forms and other ways. I´m not a super user of PowerBi and PowerApps so maybe I have done something wrong....&lt;/P&gt;</description>
    <pubDate>Thu, 27 Feb 2020 10:17:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-02-27T10:17:32Z</dc:date>
    <item>
      <title>How do I solve user API credentials in a report?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-do-I-solve-user-API-credentials-in-a-report/m-p/950781#M22510</link>
      <description>&lt;P&gt;I´m doing a Power Bi report that use data from a API. I have done a table with the credentials to the API, username, password and subscriptionkey. The first question to all tables with data is to get the token from the API so I can ask the question correct. Looks like this in my table and the advanced editor:&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;Url = Text.Format("&lt;A href="https://api.hey.com/fun/authentication/login?username=#{0}&amp;amp;password=#{1}&amp;quot;,{#&amp;quot;UserIdFile" target="_blank" rel="noopener"&gt;https://api.hey.com/fun/authentication/login?username=#{0}&amp;amp;password=#{1}",{#"UserIdFile&lt;/A&gt;", Uri.EscapeDataString(#"PasswordFile")}),&lt;BR /&gt;TokenSource = Json.Document(Web.Contents(Url, [Headers=[#"Ocp-Apim-Subscription-Key"=SubscriptionKey]])),&lt;BR /&gt;userCode = TokenSource[userCode],&lt;BR /&gt;Ask = Text.Format("&lt;A href="https://api.hey.com/fun/v1/machines/#{0}/history/utilization?start=#{1}&amp;amp;end=#{2}&amp;amp;expand=1" target="_blank" rel="noopener"&gt;https://api.hey.com/fun/v1/machines/#{0}/history/utilization?start=#{1}&amp;amp;end=#{2}&amp;amp;expand=1&lt;/A&gt;", {#"MachineId", #"startDate", #"endDate"}),&lt;BR /&gt;Source = Json.Document(Web.Contents(Ask, [Headers=[#"X-Auth-Token"=userCode, #"Ocp-Apim-Subscription-Key"=SubscriptionKey]])),&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;My table with the credentials looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="creds.JPG" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/240334i9DDC36376F6AE9F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="creds.JPG" alt="creds.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;One row with my username, password and sub key.&lt;/P&gt;&lt;P&gt;When I refresh the reports everything works fine and I get new data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But now the tricky part starts &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My user of this reports when I publish them need to be able to update the credentials with their own ones.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I solve that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked into using PowerApps with edit forms and other ways. I´m not a super user of PowerBi and PowerApps so maybe I have done something wrong....&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 10:17:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-do-I-solve-user-API-credentials-in-a-report/m-p/950781#M22510</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-27T10:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I solve user API credentials in a report?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-do-I-solve-user-API-credentials-in-a-report/m-p/955249#M22544</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;This can only be done using Power Query extension (and thus creating a custom connector for the API).&amp;nbsp;&lt;BR /&gt;&lt;A href="https://docs.microsoft.com/en-us/power-query/handlingauthentication" target="_blank"&gt;https://docs.microsoft.com/en-us/power-query/handlingauthentication&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 13:03:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-do-I-solve-user-API-credentials-in-a-report/m-p/955249#M22544</guid>
      <dc:creator>JirkaZ</dc:creator>
      <dc:date>2020-03-02T13:03:36Z</dc:date>
    </item>
  </channel>
</rss>

