<?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: Proc HTTP Cursor Based Pagination in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-HTTP-Cursor-Based-Pagination/m-p/793920#M81512</link>
    <description>&lt;P&gt;I wanted to follow-up on my previous message. Can anyone explain the best way to make a paginated request in SAS. Here is the documentation I am just not sure how to translate this into my SAS code.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://shopify.dev/api/usage/pagination-rest" target="_blank"&gt;https://shopify.dev/api/usage/pagination-rest&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It looks like I need to somehow access the rel="next" that prints in the headers file to tell SAS to pull the next set of products.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Feb 2022 22:27:01 GMT</pubDate>
    <dc:creator>CR-Horton</dc:creator>
    <dc:date>2022-02-01T22:27:01Z</dc:date>
    <item>
      <title>Proc HTTP Cursor Based Pagination</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-HTTP-Cursor-Based-Pagination/m-p/787169#M81360</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I have found this community to be very helpful and have another issue I am working through and looking for some guidance. I am trying to pull in some data from Shopify that uses cursor based pagination. I have 1K+ products I need to pull in and looking for a way to essentially loop through the pages and not just pull in the initial amount which is 50.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;What I have gathered so far is I need to somehow reference the link headers that look something like this: "Link: &amp;lt;&lt;A href="https://tXXXXXXXXXXXX.myshopify.com/admin/api/2021-10/products.json?limit=50&amp;amp;page_info=eyJsYXN0X2lkIjo0Njk4MTgzNDAxNTE4LCJs" target="_blank"&gt;https://tXXXXXXXXXXXX.myshopify.com/admin/api/2021-10/products.json?limit=50&amp;amp;page_info=eyJsYXN0X2lkIjo0Njk4MTgzNDAxNTE4LCJs&lt;/A&gt;&lt;BR /&gt;YXN0X3ZhbHVlIjoiQmFqYSBEZXNpZ25zIExQOSBTcG9ydCBMRUQgTGlnaHQiLCJkaXJlY3Rpb24iOiJuZXh0In0&amp;gt;; rel="next"" (see:&amp;nbsp;&lt;A href="https://shopify.dev/api/usage/pagination-rest" target="_self"&gt;https://shopify.dev/api/usage/pagination-rest&lt;/A&gt;&amp;nbsp;) I was able to generate the link headers in the log using the "headerout=headers" statement shown in my code below. How can I then take that sort of information (specifically the "rel="next") and use it to then pull the next page. Or perhaps there is a much easier way to do this? For other APIs I have been able to loop through the pages, but that doesn't appear to be an option here.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Here is my code that works, but only pulls the first 50:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let accesskey=XXXXXXXXXX;&lt;/P&gt;&lt;P&gt;%let fullurl=&lt;A href="https://XXXXXXX.myshopify.com/admin/api/2021-10/products.json" target="_blank"&gt;https://XXXXXXX.myshopify.com/admin/api/2021-10/products.json&lt;/A&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename tb_prods temp;&lt;BR /&gt;filename headers temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc http&lt;BR /&gt;url= "&amp;amp;fullurl"&lt;BR /&gt;method="GET" out=tb_prods headerout=headers;&lt;BR /&gt;headers&lt;BR /&gt;"X-Shopify-Access-Token"="&amp;amp;accesskey.";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;infile headers;&lt;BR /&gt;input;&lt;BR /&gt;put _infile_;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 21:12:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-HTTP-Cursor-Based-Pagination/m-p/787169#M81360</guid>
      <dc:creator>CR-Horton</dc:creator>
      <dc:date>2021-12-22T21:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Proc HTTP Cursor Based Pagination</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-HTTP-Cursor-Based-Pagination/m-p/787338#M81361</link>
      <description>&lt;P&gt;Can you try?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let fullurl=https://XXXXXXX.myshopify.com/admin/api/2021-10/products.json?limit=2000;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Dec 2021 13:13:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-HTTP-Cursor-Based-Pagination/m-p/787338#M81361</guid>
      <dc:creator>kelxxx</dc:creator>
      <dc:date>2021-12-24T13:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc HTTP Cursor Based Pagination</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-HTTP-Cursor-Based-Pagination/m-p/787929#M81367</link>
      <description>&lt;P&gt;Unfortunately, Shopify limits the product API calls to 250 or less.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the best I can do with one API call is:&lt;BR /&gt;%let fullurl=&lt;A href="https://XXXXXXXX.myshopify.com/admin/api/2021-10/products.json?limit=250" target="_blank"&gt;https://XXXXXXXX.myshopify.com/admin/api/2021-10/products.json?limit=250&lt;/A&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am needing to do cursor based pagination. Right now this is printing in the log:&lt;BR /&gt;Link: &amp;lt;&lt;A href="https://XXXXXX.myshopify.com/admin/api/2021-10/products.json" target="_blank"&gt;https://XXXXXX.myshopify.com/admin/api/2021-10/products.json&lt;/A&gt; limit=250&amp;amp;page_info=eyJsYXN0X2lkIjo2NjU0NjU1NjYwMDc4LCJsYXN0X3ZhbHVlIjoiQ2FsaSBSYWlzZWQgTG93ZXIgQ29udHJvbCBBcm0gU2tpZCBQbGF0ZSAtIFRveW90YSBUYWNvbWEgKDIwMDUtMjAyMSkiLCJkaXJlY3Rpb24iOiJuZXh0In0&amp;gt;; rel="next"&lt;BR /&gt;&lt;BR /&gt;I am basically needing to reference the "rel="next" in my code to tell SAS to pull the next 250 products.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 16:35:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-HTTP-Cursor-Based-Pagination/m-p/787929#M81367</guid>
      <dc:creator>CR-Horton</dc:creator>
      <dc:date>2021-12-31T16:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Proc HTTP Cursor Based Pagination</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-HTTP-Cursor-Based-Pagination/m-p/793920#M81512</link>
      <description>&lt;P&gt;I wanted to follow-up on my previous message. Can anyone explain the best way to make a paginated request in SAS. Here is the documentation I am just not sure how to translate this into my SAS code.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://shopify.dev/api/usage/pagination-rest" target="_blank"&gt;https://shopify.dev/api/usage/pagination-rest&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It looks like I need to somehow access the rel="next" that prints in the headers file to tell SAS to pull the next set of products.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 22:27:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-HTTP-Cursor-Based-Pagination/m-p/793920#M81512</guid>
      <dc:creator>CR-Horton</dc:creator>
      <dc:date>2022-02-01T22:27:01Z</dc:date>
    </item>
  </channel>
</rss>

