Blank link returned in response header when paginated REST Admin API endpoints?

Highlighted
Excursionist
28 1 0

Hi,

Have anyone meet this case . I try to change to Cursor-based pagination but no luck

 

string(18949) "HTTP/2 200 
date: Fri, 20 Sep 2019 02:11:24 GMT
content-type: application/json; charset=utf-8
set-cookie: __cfduid=de4e3f32d47050adadae399a85e22dc491568945484; expires=Sat, 19-Sep-20 02:11:24 GMT; path=/; domain=.myshopify.com; HttpOnly
x-sorting-hat-podid: 47
x-sorting-hat-shopid: 15636398128
vary: Accept-Encoding
referrer-policy: origin-when-cross-origin
x-frame-options: DENY
x-shopid: 15636398128
x-shardid: 47
x-stats-userid: 
x-stats-apiclientid: 2986379
x-stats-apipermissionid: 193326546992
http_x_shopify_shop_api_call_limit: 1/40
x-shopify-shop-api-call-limit: 1/40
x-shopify-api-version: 2019-07
link: ; rel="next"
strict-transport-security: max-age=7889238
x-request-id: 7c32bc05-779b-48f2-a0c3-fba414bb9728
x-shopify-stage: canary
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://dme0ih8comzn4.cloudfront.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=7c32bc05-779b-48f2-a0c3-fba414bb9728
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=7c32bc05-779b-48f2-a0c3-fba414bb9728
x-dc: 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"}]}expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"server: cloudflare
cf-ray: 519044bc9dd23377-HKG

The call look like :  GET https://mystore.myshopify.com/admin/api/2019-07/products.json?limit=3 (I have 15 test products)

The response header I get was:

link: ; rel="next"

There's no link in response header. It should have one so that I can redirect to get the next page.

Can anyone help me?

0 Likes
Trailblazer
271 59 53

Hi, @tokito,

This is Evita from On The Map.

 

https://community.shopify.com/c/Shopify-APIs-SDKs/Rest-API-cursor-based-pagination-returning-empty-h...

According to this, the value is there, but it's not showing up because of angel brackets. So try using the value and see if it returns the string.

 

Best,
Evita

On The Map Marketing | Developing custom Shopify Sites & Apps is our thing

- Install our latest app Accessibly - Makes your store accessible for everyone, helps to avoid fines
- Inc 5000 | Shopify Parners | 20+ stores launched | 300+ active clients
- Need help with your Shopify store? Reach out to us!
0 Likes