<?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: Oauth2 API with required multiple date parameters in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Oauth2-API-with-required-multiple-date-parameters/m-p/2505757#M36018</link>
    <description>&lt;P&gt;Follow the documentation of the API you are querying?&lt;/P&gt;</description>
    <pubDate>Tue, 10 May 2022 19:52:18 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2022-05-10T19:52:18Z</dc:date>
    <item>
      <title>Oauth2 API with required multiple date parameters</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Oauth2-API-with-required-multiple-date-parameters/m-p/2503089#M35999</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Recently, I have been successful in pulling data using API calls with the following script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;let&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ClientId = "xxxxxxxx",&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ClientSecret = "xxxxxxxxxxx",&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Uri = "&lt;A href="https://xxxxxxxxxxxxx" target="_blank" rel="noopener"&gt;https://xxxxxxxxxxxxx&lt;/A&gt;",&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;dataURL = "&lt;A href="https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" target="_blank" rel="noopener"&gt;https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&lt;/A&gt;",&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;body ="{&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;""grant_type"": ""client_credentials"",&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;""client_id"": """ &amp;amp; ClientId &amp;amp; """,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;""client_secret"": """ &amp;amp; ClientSecret &amp;amp; """&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}",&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;getToken = Json.Document(&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Web.Contents(&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Uri, &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;[&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;RelativePath="xxxxxx/api/v2/oauth/token",&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Headers = [#"Content-Type"="application/json"],&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Content=Text.ToBinary(body)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;token = getToken[token],&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;AuthHeaders = [Authorization = "Bearer " &amp;amp; token],&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Response = Json.Document(Web.Contents(scheduleURL, [Headers = AuthHeaders])),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;#"Converted to Table" = Table.FromList(Response, Splitter.SplitByNothing(), null, null, ExtraValues.Error),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"schedule_id", "name", "is_archived", "order", "positions"}, {"Column1.schedule_id", "Column1.name", "Column1.is_archived", "Column1.order", "Column1.positions"}),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;#"Expanded Column1.positions" = Table.ExpandListColumn(#"Expanded Column1", "Column1.positions"),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;#"Expanded Column1.positions1" = Table.ExpandRecordColumn(#"Expanded Column1.positions", "Column1.positions", {"position_id", "position_qualification_id", "label", "order"}, {"Column1.positions.position_id", "Column1.positions.position_qualification_id", "Column1.positions.label", "Column1.positions.order"}),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;#"Changed Type" = Table.TransformColumnTypes(#"Expanded Column1.positions1",{{"Column1.schedule_id", Int64.Type}, {"Column1.name", type text}, {"Column1.is_archived", type logical}, {"Column1.order", Int64.Type}, {"Column1.positions.position_id", Int64.Type}, {"Column1.positions.position_qualification_id", Int64.Type}, {"Column1.positions.label", type text}, {"Column1.positions.order", Int64.Type}})&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;in&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;#"Changed Type"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works. However, now I try to call different API (different table) with multiple date parameters required (startDate and endDate). Can someone help me with that? I really appreciate it. Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 20:54:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Oauth2-API-with-required-multiple-date-parameters/m-p/2503089#M35999</guid>
      <dc:creator>Falcon</dc:creator>
      <dc:date>2022-05-09T20:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Oauth2 API with required multiple date parameters</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Oauth2-API-with-required-multiple-date-parameters/m-p/2505757#M36018</link>
      <description>&lt;P&gt;Follow the documentation of the API you are querying?&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 19:52:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Oauth2-API-with-required-multiple-date-parameters/m-p/2505757#M36018</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-05-10T19:52:18Z</dc:date>
    </item>
  </channel>
</rss>

