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_infoparameter can’t include any other parameters except forlimitandfields(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 ?