Problems with Cursor Pagination

Highlighted
Shopify Partner
2 0 0

I'm currently converting our code to use the Cursor based pagination in the latest API revision but I'm not actually receiving the "Link" header with the relative pages.

 

I'm calling admin/products.json?limit=2 (there are 5 products in our dev system) so I'm expecting to see 3 pages and as such the Link header for the next page etc.

 

However the response does not contain a Link header at all? What am I doing wrong? 

 

Raw response:

HTTP/1.1 200 OK
Date: Thu, 14 May 2020 08:12:31 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d276e786225891c9b11d5bb06b5a141b91589443951; expires=Sat, 13-Jun-20 08:12:31 GMT; path=/; domain=.myshopify.com; HttpOnly; SameSite=Lax
X-Sorting-Hat-PodId: 98
X-Sorting-Hat-ShopId: 11845314
Vary: Accept-Encoding
Referrer-Policy: origin-when-cross-origin
X-Frame-Options: DENY
X-ShopId: 11845314
X-ShardId: 98
X-Stats-UserId:
X-Stats-ApiClientId: 1270978
X-Stats-ApiPermissionId: 204807602275
HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT: 1/40
X-Shopify-Shop-Api-Call-Limit: 1/40
X-Shopify-API-Version: 2019-04
X-Shopify-API-Version-Warning: https://shopify.dev/concepts/about-apis/versioning
Strict-Transport-Security: max-age=7889238
X-Shopify-Stage: production
Content-Security-Policy: default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopify.cn https://checkout.shopifycs.com https://js-agent.newrelic.com https://bam.nr-data.net https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com https://widget.intercom.io https://js.intercomcdn.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=fdbeac2f-688e-49a3-b467-2de7be25f86c
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block; report=/xss-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=fdbeac2f-688e-49a3-b467-2de7be25f86c
X-Dc: gcp-us-central1,gcp-us-east1,gcp-us-east1
NEL: {"report_to":"network-errors","max_age":2592000,"failure_fraction":0.01,"success_fraction":0.0001}
Report-To: {"group":"network-errors","max_age":2592000,"endpoints":[{"url":"https://monorail-edge.shopifycloud.com/v1/reports/nel/20190325/shopify"}]}
X-Request-ID: fdbeac2f-688e-49a3-b467-2de7be25f86c
NEL: {"report_to":"network-errors","max_age":2592000,"failure_fraction":0.01,"success_fraction":0.0001}
Report-To: {"group":"network-errors","max_age":2592000,"endpoints":[{"url":"https://monorail-edge.shopifycloud.com/v1/reports/nel/20190325/shopify"}]}
CF-Cache-Status: DYNAMIC
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 593327996fc6e618-LHR
alt-svc: h3-27=":443"; ma=86400, h3-25=":443"; ma=86400, h3-24=":443"; ma=86400, h3-23=":443"; ma=86400
cf-request-id: 02b3d713df0000e618d3a5f200000001

 

Thanks in advance for any help!

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1041 140 167

Cursor based pagination was introduced in the 2019-07 release, try a more recent version:

 

/admin/api/2020-04/products.json?limit=2
Notice; Out of office, replies will be delayed until my return. Thanks!
0 Likes
Highlighted
Shopify Partner
2 0 0

Thanks scotty.. I assumed as I'm not specifying a version I'd get the latest..

 

0 Likes