<?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: Get data using REST API Ringover - POST method in Power Query</title>
    <link>https://community.fabric.microsoft.com/t5/Power-Query/Get-data-using-REST-API-Ringover-POST-method/m-p/1468914#M45751</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="246656" data-lia-user-login="Julien7438" class="lia-mention lia-mention-user"&gt;Julien7438&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you be specific about how it's not working.&amp;nbsp; Is it generating an error?&amp;nbsp; Is it giving you unexpected results?&amp;nbsp; Can you share what output the query does generate?&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Phil&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;If I answered your question please mark my post as the solution.&lt;BR /&gt;If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up. &lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Nov 2020 09:16:07 GMT</pubDate>
    <dc:creator>PhilipTreacy</dc:creator>
    <dc:date>2020-11-02T09:16:07Z</dc:date>
    <item>
      <title>Get data using REST API Ringover - POST method</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Get-data-using-REST-API-Ringover-POST-method/m-p/1466520#M45680</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My name is Julien, Business Analyst, its been few days that i try to Get data from a REST API - POST method with a query using M.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here the query :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(StartDate as text)=&amp;gt;
let
    Url = "https://public-api.ringover.com/v2/calls",
    Token = "here is my key",
    EntitiesPerPage = 100,
    StartDate = Date.ToText(Date.FromText(StartDate), "yyyy-MM-ddT00:00:00Z"),

    GetJson = (Url, LastIdReturned) =&amp;gt;
        let Body = "{""intra"":false, ""limit_count"":" &amp;amp; Text.From(EntitiesPerPage) &amp;amp; ",
    ""start_date"":""" &amp;amp; StartDate &amp;amp; """,
    ""last_id_returned"":" &amp;amp; Text.From(LastIdReturned) &amp;amp; "}",
    Options = [Headers=[ #"Authorization" = Token ], Content=Text.ToBinary(Body)],
            RawData = Web.Contents(Url, Options),
            Json = Json.Document(RawData)
        in  Json,

    GetEntityCount = () =&amp;gt;
        let Json = GetJson(Url, 0),
            Count = Json[#"total_call_count"]
        in  Count,

    GetPage = (LastIdReturned) =&amp;gt;
        let Json  = GetJson(Url,LastIdReturned),
            LastIdReturned = try List.Last(Json[#"call_list"])[cdr_id] otherwise 0,
            data = try Json[#"call_list"] otherwise null,
            res = [Data=data, Next=LastIdReturned]
        in  res,

    NbRecords = GetEntityCount(),
    EntityCount = List.Max({ EntitiesPerPage, NbRecords }),
    PageCount   = Number.RoundUp(EntityCount / EntitiesPerPage),
   
     GeneratedList =
        List.Generate(
        ()=&amp;gt;[i=0, res = GetPage(0)],
        each [i]&amp;lt;PageCount and [res][Data]&amp;lt;&amp;gt;null,
        each [i=[i]+1, res = GetPage([res][Next])],
        each [res][Data]),
   
    Table = Table.FromList(GeneratedList, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
    Table&lt;/PRE&gt;&lt;P&gt;It's a bit complicated due to the pagination, and this query does not works and i not find why, actually its return the all lists but duplicates of the first one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the following link of Ringover for use there API but it does not help me neither :&amp;nbsp;&lt;A href="https://developer.ringover.com/" target="_blank" rel="noopener"&gt;https://developer.ringover.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have ask help from Ringover or colleagues but im still stuck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If someone can help me, it will be wonderfull...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;Julien&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 19:06:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Get-data-using-REST-API-Ringover-POST-method/m-p/1466520#M45680</guid>
      <dc:creator>Julien7438</dc:creator>
      <dc:date>2020-10-30T19:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Get data using REST API Ringover - POST method</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Get-data-using-REST-API-Ringover-POST-method/m-p/1468056#M45721</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="246656" data-lia-user-login="Julien7438" class="lia-mention lia-mention-user"&gt;Julien7438&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a bit confused.&amp;nbsp; Does this work or not?&amp;nbsp; Is the issue just that you are getting the first list duplicated?&lt;/P&gt;&lt;P&gt;If that is the case then your initial conditions for &lt;STRONG&gt;res&lt;/STRONG&gt; in List.Generate may need to be changed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;()=&amp;gt;[i=0, res = GetPage(0)],&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Phil&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;If I answered your question please mark my post as the solution.&lt;BR /&gt;If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up. &lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2020 00:24:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Get-data-using-REST-API-Ringover-POST-method/m-p/1468056#M45721</guid>
      <dc:creator>PhilipTreacy</dc:creator>
      <dc:date>2020-11-02T00:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Get data using REST API Ringover - POST method</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Get-data-using-REST-API-Ringover-POST-method/m-p/1468901#M45750</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="264323" data-lia-user-login="PhilipTreacy" class="lia-mention lia-mention-user"&gt;PhilipTreacy&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your answer, the code don't work and do exactly what you say.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried different way using this topic but i can't figure that.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Rest-API-Json-several-pages-automatically-call-the-next-page-URL/td-p/236189" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/Rest-API-Json-several-pages-automatically-call-the-next-page-URL/td-p/236189&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your right the iteration part have an issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot, i will investigate in this way, if you have any suggestion, let me know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Julien&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2020 09:08:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Get-data-using-REST-API-Ringover-POST-method/m-p/1468901#M45750</guid>
      <dc:creator>Julien7438</dc:creator>
      <dc:date>2020-11-02T09:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get data using REST API Ringover - POST method</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Get-data-using-REST-API-Ringover-POST-method/m-p/1468914#M45751</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="246656" data-lia-user-login="Julien7438" class="lia-mention lia-mention-user"&gt;Julien7438&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you be specific about how it's not working.&amp;nbsp; Is it generating an error?&amp;nbsp; Is it giving you unexpected results?&amp;nbsp; Can you share what output the query does generate?&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Phil&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;If I answered your question please mark my post as the solution.&lt;BR /&gt;If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up. &lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2020 09:16:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Get-data-using-REST-API-Ringover-POST-method/m-p/1468914#M45751</guid>
      <dc:creator>PhilipTreacy</dc:creator>
      <dc:date>2020-11-02T09:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Get data using REST API Ringover - POST method</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Get-data-using-REST-API-Ringover-POST-method/m-p/1469049#M45754</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="264323" data-lia-user-login="PhilipTreacy" class="lia-mention lia-mention-user"&gt;PhilipTreacy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="tlid-results-container results-container"&gt;&lt;DIV class="tlid-result result-dict-wrapper"&gt;&lt;DIV class="result tlid-copy-target"&gt;&lt;DIV class="text-wrap tlid-copy-target"&gt;&lt;DIV class="result-shield-container tlid-copy-target"&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;BR /&gt;&lt;SPAN&gt;For example if I set the StartDate parameter to "2020-10-27", the query will generate a number of lists, precisely 42 which is normal because each list contains 100 records (rows) and I know the database&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;has generated 4200 rows since that date (42 * 100).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But in reality I have the same unique list 42 times, so when I remove the duplicate I only have 100 rows (my first list).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I didn't find how to share a photo or screenshot, so, I hope I was clear.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;Thanks again for your time.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="result-shield-container tlid-copy-target"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="result-shield-container tlid-copy-target"&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;BR&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="result-shield-container tlid-copy-target"&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;Julien&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Nov 2020 10:11:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Get-data-using-REST-API-Ringover-POST-method/m-p/1469049#M45754</guid>
      <dc:creator>Julien7438</dc:creator>
      <dc:date>2020-11-02T10:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Get data using REST API Ringover - POST method</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Get-data-using-REST-API-Ringover-POST-method/m-p/1469472#M45764</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="264323" data-lia-user-login="PhilipTreacy" class="lia-mention lia-mention-user"&gt;PhilipTreacy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finaly my colleague Data Architect found the solution.&lt;/P&gt;&lt;P&gt;The LasIdReturned in GetPage row 24&amp;nbsp; "LastIdReturned = try List.Last(Json[#"call_list"])[cdr_id] otherwise 0," was in conflict with all the "LastIdReturned" before.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So he have rename all the "LastIdReturned before" by "LastId" and now it's works very well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank to yo again for youur time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Julien&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2020 13:03:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Get-data-using-REST-API-Ringover-POST-method/m-p/1469472#M45764</guid>
      <dc:creator>Julien7438</dc:creator>
      <dc:date>2020-11-02T13:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get data using REST API Ringover - POST method</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Get-data-using-REST-API-Ringover-POST-method/m-p/2046028#M60200</link>
      <description>&lt;P&gt;Hi Julien,&lt;/P&gt;&lt;P&gt;I've been trying to do the same thing as you. Not really a pro with PowerQuery.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried your solution but all I receive is duplicated entities. If I choose 100 entities per page, it fetch 100 entities and then duplicates them.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the solution you published afterward but it changes nothing, maybe I didn't understand you. Can you copy&amp;amp;paste the new code or something?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My aim is to gather all the calls from Ringover from a selected startdate and then update new data everyday acumulatively.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope I can still reach you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Arturo&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 11:25:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Get-data-using-REST-API-Ringover-POST-method/m-p/2046028#M60200</guid>
      <dc:creator>ArturoMP</dc:creator>
      <dc:date>2021-08-30T11:25:35Z</dc:date>
    </item>
  </channel>
</rss>

