<?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: A generic REST API connector? in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/A-generic-REST-API-connector/m-p/3465936#M44838</link>
    <description>&lt;P&gt;This is not "generic" as it is specific for Zendesk. But it should be possible to make it generic&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/Custom-Zendesk-Connector-Power-Query-Code/td-p/2407620" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/Custom-Zendesk-Connector-Power-Query-Code/td-p/2407620&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Oct 2023 00:40:59 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-10-09T00:40:59Z</dc:date>
    <item>
      <title>A generic REST API connector?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/A-generic-REST-API-connector/m-p/1718704#M28355</link>
      <description>&lt;P&gt;I need to query data from a &lt;A href="https://developer.veevavault.com/api/" target="_self"&gt;REST API&lt;/A&gt;&amp;nbsp;but couldn't find any appropriate connector, or even a generic connector. Such a connector should be able to handle requests in any HTTP method, manage authentication by passing a user name and password as parameters of a POST request and using the returned token in the header of subsequent requests, handle pagination of results (i.e. looping queries until there's no next page)...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&lt;EM&gt;generic&lt;/EM&gt; connector may not be possible, and I may need to create a custom connector, but it's a steep learning curve, so I was hoping for at least something that I can start from and modify.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any hint?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 10:33:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/A-generic-REST-API-connector/m-p/1718704#M28355</guid>
      <dc:creator>mrgou</dc:creator>
      <dc:date>2021-03-12T10:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: A generic REST API connector?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/A-generic-REST-API-connector/m-p/1721671#M28373</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/290299"&gt;@mrgou&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;You can try to use the following M query code if they work on your side:&lt;/FONT&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    rooturl = "https://myserver.com/",
    //profile id
    oath_oidc_profile_id = "xxxxxx",
    //access token from your portal configurations
    token = "xxxxxxx",
    relativeURL =
        "auth/oauth/session/"
        &amp;amp; oath_oidc_profile_id,
    //connect to server
    GetJson =
        Web.Contents(
            rooturl,
            [
                Headers = [
                    #"Authorization" = "Bearer" &amp;amp; token,
                    #"Content-Type" = "application/x-www-form-urlencoded"
                ],
                RelativePath = relativeURL
            ]
        ),
    //'session Id' for advanced operation
    sessionId = Json.Document(GetJson)[sessionId],
    Source =
        Web.Contents(
            rooturl,
            [
                Headers = [
                    #"Authorization" = "Bearer" &amp;amp; token,
                    #"Content-Type" = "application/x-www-form-urlencoded"
                ],
                RelativePath = "xxxx/xxxxx/xxxxx",
                Content = Text.ToBinary("client_id=" &amp;amp; sessionId)
            ]
        )
in
    Source&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;If the above not help, you can also take a look at the following link about pull data from the rest API with authentication:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://community.powerbi.com/t5/Power-Query/Pull-data-from-a-REST-API-Authentication/td-p/246006" target="_self"&gt;Pull data from a REST API Authentication&lt;/A&gt;&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 07:09:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/A-generic-REST-API-connector/m-p/1721671#M28373</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-15T07:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: A generic REST API connector?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/A-generic-REST-API-connector/m-p/1724975#M28396</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp;Thank you for sharing this. I looked into the M reference, and also found a WebAction.Request method that appears to allow using other HTTP methods. I guess I'll have to go ahead and study the language. Unfortunately, I couldn't find any good learning resource, so I'll have to do it the hard way with the specification and reference documentation from Microsoft!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 11:22:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/A-generic-REST-API-connector/m-p/1724975#M28396</guid>
      <dc:creator>mrgou</dc:creator>
      <dc:date>2021-03-16T11:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: A generic REST API connector?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/A-generic-REST-API-connector/m-p/1726586#M28411</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;HI&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/290299"&gt;@mrgou&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;If you can't find enough code sample/tutorials of power query functions. You can also take a look at&amp;nbsp;Chris Webb's blog, he shares lots of blogs of power query function usage:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://blog.crossjoin.co.uk/?s=Web.Contents&amp;amp;submit=Search" target="_self"&gt;Chris Webb's BI Blog # Web.Contents&lt;/A&gt;&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 06:15:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/A-generic-REST-API-connector/m-p/1726586#M28411</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-17T06:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: A generic REST API connector?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/A-generic-REST-API-connector/m-p/2425283#M35228</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have two questions,&lt;BR /&gt;&lt;BR /&gt;First, It is my understanding this would only work locally and not in the service. As it will treat "Web.Contents(&amp;lt;url variable&amp;gt;" in this case "Web.Contents(rooturl" as a dynamic connector and thus will not refresh.&amp;nbsp; Changing it to Web.Contents("&lt;A href="https://myserver.com/" target="_blank" rel="noopener"&gt;https://myserver.com/&lt;/A&gt;" .. would result in the service removing this error. The service might still show the "invalid credentials error".&amp;nbsp; According to Chris Webb this can be fixed in code, but i am not sure how. The easier option is just to turn off the credential check in the service. It does need more testing but it seems to work.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Last question, is around this line here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sessionId = Json.Document(GetJson)[sessionId]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had a similar code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Json  = GetJson(Url),  //Getjson return a Json.Document.
Value = Json[#"tickets"]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which I tried to parameterize.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;//this works
Value = Json[tickets]

//but this does not:
var = "tickets"
Value = Json[var]

//ended up with:
var = "tickets"
Value = Record.FieldValues(Record.SelectFields(Json, var)){0}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There has got to be single or at least simplier method... right?&lt;BR /&gt;&lt;BR /&gt;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 21:48:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/A-generic-REST-API-connector/m-p/2425283#M35228</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-29T21:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: A generic REST API connector?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/A-generic-REST-API-connector/m-p/2881197#M39541</link>
      <description>&lt;P&gt;The code to generate the token seems to work great, except when I use it against an api endpoint where there are so many records that the token eventually expires. It seems that the code only uses the same token over and over.&lt;/P&gt;&lt;P&gt;See my issue here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Power-Query/Bearer-Token-Expires-before-GET-Request-Completes/m-p/2847411/highlight/true#M88507" target="_blank"&gt;https://community.powerbi.com/t5/Power-Query/Bearer-Token-Expires-before-GET-Request-Completes/m-p/2847411/highlight/true#M88507&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 20:02:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/A-generic-REST-API-connector/m-p/2881197#M39541</guid>
      <dc:creator>sherodkeen</dc:creator>
      <dc:date>2022-11-02T20:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: A generic REST API connector?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/A-generic-REST-API-connector/m-p/3465936#M44838</link>
      <description>&lt;P&gt;This is not "generic" as it is specific for Zendesk. But it should be possible to make it generic&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/Custom-Zendesk-Connector-Power-Query-Code/td-p/2407620" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/Custom-Zendesk-Connector-Power-Query-Code/td-p/2407620&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 00:40:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/A-generic-REST-API-connector/m-p/3465936#M44838</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-09T00:40:59Z</dc:date>
    </item>
  </channel>
</rss>

