Issue with REST API (pages.json endpoint) pagination with filters

We are trying to fetch the pages for a store using the Shopify REST API

GET {hostname}/admin/api/2023-01/pages.json?published_status=published

as per the pagination docs https://shopify.dev/docs/api/usage/pagination-rest

We are getting the next link in the response header, which means there is more data to be fetched.

2nd Request

GET {hostname}/admin/api/2023-01/pages.json?page_info={page_info}

The issue is that for the second request, the initial filters are not applied which in this case is

published_status=published

We are getting unpublished pages in the second page results.
We tried adding the parameter manually but got the following error

{
    "errors": {
        "published_status": "published_status cannot be passed when page_info is present. See https://shopify.dev/api/usage/pagination-rest for more information."
    }
}

Based on the docs, applying these filters in the second request should be automatic:

A request that includes the page_info parameter can’t include any other parameters except for limit and fields (if it applies to the endpoint). If you want your results to be filtered by other parameters, then you need to include those parameters in the first request you make.

We also tried with different API versions, the filter is not applied to the second request in any of them.

Is there something we are doing wrong or is this is an issue with the API ?

1 Like

Hi There,

Yes this is a known bug (to me at least) that in my estimation was added on Jan 31st of this year.

Please record your x-request-id which is returned in the headers of your requests and contact your shopify partner associate with the problem. You can post it here as well and hopefully @ShopifyDevSup will also have some time to pass this on to the dev team in parallel.

Cheers,

Gary