<?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: Custom Connector with Token Refresh in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Connector-with-Token-Refresh/m-p/2323176#M34264</link>
    <description>&lt;P&gt;Sadly I'm struggling to get out of the gate lol&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The authentication is working correctly and returns me a token, which I've stored in token&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; loginPayload = [
            username = Extension.CurrentCredential()[Username],
            password = Extension.CurrentCredential()[Password]
        ],
        loginBody = Json.Document(loginPayload),
        responseLogin = Web.Contents("https://api.company.io/login", [
            Headers = [#"Content-Type" = "application/json"],
            Content = loginBody
        ]),

        
        token = Json.Document(responseLogin)[token],&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I now want to use this to query the endpoint:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    responseAlert = Web.Contents("https://company.io/v2/alert", [
            Headers = [
                #"Content-Type" = "application/json",
                #"x-redlock-auth" = token
            ],
            Content = alertBody
        ]),

        a = Json.Document(responseAlert)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;However Power Query keeps complaining "The parameter is expected to be of type Text.Type or Binary.Type", I tried wrapping Record.Field and Text.From but I cannot seem to be able to use my extracted JSON value as a header later down the line, any ideas?&lt;/P&gt;</description>
    <pubDate>Mon, 07 Feb 2022 13:20:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-02-07T13:20:49Z</dc:date>
    <item>
      <title>Custom Connector with Token Refresh</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Connector-with-Token-Refresh/m-p/2320423#M34220</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I need to create a Custom Connector to query Prisma Cloud REST API (sadly there isn't already a connector), the platform takes a username and password JSON POST to /&lt;SPAN&gt;login&amp;nbsp;&lt;/SPAN&gt;and returns a JWT token, that token then needs to be added to the header when calling for data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some of the reports I need create are many pages long and the token only lasts around 8 minutes so I need to set a timer to extend the token around the 5 minute mark, to do this I need to issue a GET to /&lt;SPAN&gt;auth_token/extend that will return a new token I can use for another 5 minutes or until my paginator has complete.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Once I have my token I can POST my query to&amp;nbsp;/v2/alert which will keep returning json.&lt;/SPAN&gt;&lt;SPAN&gt;nextPageToken (that needs to be added to payload.pageToken) until the load is complete&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've written a connector for DOMO which is pure JavaScript but I'm new to PowerBI and the M language, I'm assuming this is two complex for the magic functions to help me, any tips would be much appreciated.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 17:51:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Connector-with-Token-Refresh/m-p/2320423#M34220</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-02-04T17:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Connector with Token Refresh</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Connector-with-Token-Refresh/m-p/2321428#M34237</link>
      <description>&lt;P&gt;That seems all doable.&amp;nbsp; What do you need help with?&lt;/P&gt;</description>
      <pubDate>Sun, 06 Feb 2022 01:15:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Connector-with-Token-Refresh/m-p/2321428#M34237</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-02-06T01:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Connector with Token Refresh</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Connector-with-Token-Refresh/m-p/2321579#M34238</link>
      <description>&lt;P&gt;Not writing a connector before the areas I would need help with is.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;1. Authentication function getting the username and password from the user to get a token, then updating the token after a time (or number of data calls if easier)&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. How to create a while loop or similar to keep getting data until the next page is blank.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;the trippin example uses the magic functions so I wasn't sure how to do this manually. I'm a PHP/JavaScript guy so it's getting my head around the new layout (sorry), I have been looking at the tutorials.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Feb 2022 10:30:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Connector-with-Token-Refresh/m-p/2321579#M34238</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-02-06T10:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Connector with Token Refresh</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Connector-with-Token-Refresh/m-p/2321661#M34240</link>
      <description>&lt;P&gt;I wouldn't worry about #1 just yet, you can sprinkle that in later.&amp;nbsp; For #2 you can choose between List.Generate, List.Accumulate, and recursive function calls.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Feb 2022 14:33:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Connector-with-Token-Refresh/m-p/2321661#M34240</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-02-06T14:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Connector with Token Refresh</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Connector-with-Token-Refresh/m-p/2323176#M34264</link>
      <description>&lt;P&gt;Sadly I'm struggling to get out of the gate lol&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The authentication is working correctly and returns me a token, which I've stored in token&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; loginPayload = [
            username = Extension.CurrentCredential()[Username],
            password = Extension.CurrentCredential()[Password]
        ],
        loginBody = Json.Document(loginPayload),
        responseLogin = Web.Contents("https://api.company.io/login", [
            Headers = [#"Content-Type" = "application/json"],
            Content = loginBody
        ]),

        
        token = Json.Document(responseLogin)[token],&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I now want to use this to query the endpoint:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    responseAlert = Web.Contents("https://company.io/v2/alert", [
            Headers = [
                #"Content-Type" = "application/json",
                #"x-redlock-auth" = token
            ],
            Content = alertBody
        ]),

        a = Json.Document(responseAlert)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;However Power Query keeps complaining "The parameter is expected to be of type Text.Type or Binary.Type", I tried wrapping Record.Field and Text.From but I cannot seem to be able to use my extracted JSON value as a header later down the line, any ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 13:20:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Connector-with-Token-Refresh/m-p/2323176#M34264</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-02-07T13:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Connector with Token Refresh</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Connector-with-Token-Refresh/m-p/2327504#M34299</link>
      <description>&lt;P&gt;Hi @Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Hope these will help you:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/The-parameter-is-expected-to-be-of-type-Text-Type-or-Binary-Type/m-p/49345" target="_self"&gt;https://community.powerbi.com/t5/Desktop/The-parameter-is-expected-to-be-of-type-Text-Type-or-Binary-Type/m-p/49345&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://radacad.com/exception-reporting-in-power-query-and-power-bi-part-2-catching-error-rows-for-all-columns-in-the-table-section-1" target="_self"&gt;https://radacad.com/exception-reporting-in-power-query-and-power-bi-part-2-catching-error-rows-for-all-columns-in-the-table-section-1&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>Wed, 09 Feb 2022 09:29:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Connector-with-Token-Refresh/m-p/2327504#M34299</guid>
      <dc:creator>V-lianl-msft</dc:creator>
      <dc:date>2022-02-09T09:29:30Z</dc:date>
    </item>
  </channel>
</rss>

