<?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: Long Running REST with Pagination in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Long-Running-REST-with-Pagination/m-p/2496894#M14380</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/30479"&gt;@KHSDM&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;If you are setting the pagination yourself, I mean, it is not automatically set in the Data Connection configuration, you can do incremental loads before each pagination. But there may be a catch here. You should be able to retake from where you have left and that depends on how the REST API was setup on the backend. So, you could loop your REST Connection until the NextURL is blank.&lt;/P&gt;
&lt;P&gt;Another possible alternative is to do data partition. Try to apply filters to your requests to reduce the number os data returned. For example, let's say you could loop through a list of countries to return subsets of data. Instead of returning all the records at once, you can return these lists per country and save all the data in the same QVD - or even partitioned QVDs, one for each country.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Mark Costa&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Dec 2024 14:21:48 GMT</pubDate>
    <dc:creator>marksouzacosta</dc:creator>
    <dc:date>2024-12-09T14:21:48Z</dc:date>
    <item>
      <title>Long Running REST with Pagination</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Long-Running-REST-with-Pagination/m-p/2496753#M14376</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;Currently, I'm loading data from a REST connection with pagination. The REST query is authenticated using a JWT token. I'm using the WITH CONNECTION clause to insert the token in the header.&lt;/P&gt;
&lt;P&gt;However, the query runs quite long, causing the token to expire and the loading to fail. Is there any workaround for this?&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;Using QSEoW.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 07:08:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Long-Running-REST-with-Pagination/m-p/2496753#M14376</guid>
      <dc:creator>KHSDM</dc:creator>
      <dc:date>2024-12-09T07:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Long Running REST with Pagination</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Long-Running-REST-with-Pagination/m-p/2496756#M14377</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/30479"&gt;@KHSDM&lt;/a&gt;&amp;nbsp; how do you manage the pagination? If you do this manually in a loop you could check the expiration during loops.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 07:15:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Long-Running-REST-with-Pagination/m-p/2496756#M14377</guid>
      <dc:creator>p_verkooijen</dc:creator>
      <dc:date>2024-12-09T07:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Long Running REST with Pagination</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Long-Running-REST-with-Pagination/m-p/2496760#M14378</link>
      <description>&lt;P&gt;I'm using the built-in pagination option. Using the Next URL option.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 07:35:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Long-Running-REST-with-Pagination/m-p/2496760#M14378</guid>
      <dc:creator>KHSDM</dc:creator>
      <dc:date>2024-12-09T07:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: Long Running REST with Pagination</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Long-Running-REST-with-Pagination/m-p/2496881#M14379</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/30479"&gt;@KHSDM&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The REST connector has no solution for this.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 13:45:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Long-Running-REST-with-Pagination/m-p/2496881#M14379</guid>
      <dc:creator>p_verkooijen</dc:creator>
      <dc:date>2024-12-09T13:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: Long Running REST with Pagination</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Long-Running-REST-with-Pagination/m-p/2496894#M14380</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/30479"&gt;@KHSDM&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;If you are setting the pagination yourself, I mean, it is not automatically set in the Data Connection configuration, you can do incremental loads before each pagination. But there may be a catch here. You should be able to retake from where you have left and that depends on how the REST API was setup on the backend. So, you could loop your REST Connection until the NextURL is blank.&lt;/P&gt;
&lt;P&gt;Another possible alternative is to do data partition. Try to apply filters to your requests to reduce the number os data returned. For example, let's say you could loop through a list of countries to return subsets of data. Instead of returning all the records at once, you can return these lists per country and save all the data in the same QVD - or even partitioned QVDs, one for each country.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Mark Costa&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 14:21:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Long-Running-REST-with-Pagination/m-p/2496894#M14380</guid>
      <dc:creator>marksouzacosta</dc:creator>
      <dc:date>2024-12-09T14:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Long Running REST with Pagination</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Long-Running-REST-with-Pagination/m-p/2497117#M14381</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/30479"&gt;@KHSDM&lt;/a&gt;&amp;nbsp;this is a short example how to handle a NextURL manually using a loop and WITH CONNECTION&lt;/P&gt;
&lt;P&gt;First create a subroutine to check if the authentication is still valid.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SUB Auth&lt;/P&gt;
&lt;P&gt;IF ExpireDateTime&amp;lt;Now() THEN&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; **** your auth call****&lt;/P&gt;
&lt;P&gt;ENDIF&lt;/P&gt;
&lt;P&gt;End Sub&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;BR /&gt;Then start the loop&lt;/U&gt;&lt;/P&gt;
&lt;DIV&gt;LIB CONNECT TO 'REST_Connection';&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;SET NextURL=&lt;A href="https://your.urltostart.with/api/orders" target="_blank"&gt;https://your.urltostart.with/api/orders&lt;/A&gt;;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Do While NextURL&amp;lt;&amp;gt;Null()&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; TRACE NextURL = $(NextURL);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; CALL Auth;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; RestConnectorMasterTable:&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; SQL SELECT&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; "Transfer-Encoding",&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; "Connection",&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; "Content-Encoding",&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; "Link",&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; "original-username",&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; "strict-transport-security",&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; "vary",&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; "Cache-Control",&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; "Content-Type",&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; "__KEY__response_header",&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; (SELECT&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; ...........&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; FROM JSON "_response_header" PK "__KEY__response_header"&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp;WITH CONNECTION(Url "$(NextURL)");&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; [_response_header]:&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; LOAD [Transfer-Encoding],&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; [Connection],&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; [Content-Encoding],&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; [Link],&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; [original-username],&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; [strict-transport-security],&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; [Cache-Control],&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; [Content-Type],&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; [__KEY__response_header]&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; RESIDENT RestConnectorMasterTable&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; WHERE NOT IsNull([__KEY__response_header]);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; DROP TABLE RestConnectorMasterTable;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; //COALESCE o.b.v. Textbetween iteratie 2 en dan 1&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; //- For the first response you need the first TextBetween &amp;lt;&amp;gt;, al subsequent need the second&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; //- At the last response there is no next link, only a previous. Therefore a WILDMATCH on *rel="next"*&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; LET NextURL=IF(WILDMATCH(PEEK('Link', 0, '_response_header'), '*next*'), COALESCE(TEXTBETWEEN(PEEK('Link', 0, '_response_header'),'&amp;lt;','&amp;gt;',2),TEXTBETWEEN(PEEK('Link', 0, '_response_header'),'&amp;lt;','&amp;gt;',1)), Null());&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; DROP TABLE _response_header;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Loop&lt;/DIV&gt;</description>
      <pubDate>Tue, 10 Dec 2024 14:40:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Long-Running-REST-with-Pagination/m-p/2497117#M14381</guid>
      <dc:creator>p_verkooijen</dc:creator>
      <dc:date>2024-12-10T14:40:53Z</dc:date>
    </item>
  </channel>
</rss>

