Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.
Solved

Pagination for product images metafields

hieudion
Visitor
1 0 0

Hi guys, 

I have a question about pagination when getting metafields of product images using REST API.
I receive no data from the next page_info.

What i used: 

https://mountbaker.myshopify.com/admin/api/2020-01/metafields.json?metafield[owner_id]=18809934476&metafield[owner_resource]=product_images&limit=1


The next page url that i get: 

<https://mountbaker.myshopify.com/admin/api/2020-01/metafields.json?limit=1&page_info=eyJsYXN0X2lkIjoxMjU1MjE4NjY5MTY1NiwibGFzdF92YWx1ZSI6IjEyNTUyMTg2NjkxNjU2IiwiZGlyZWN0aW9uIjoibmV4dCJ9>; rel="next"


Also tried with other resource like blog - same problem

https://mountbaker.myshopify.com/admin/api/2020-01/metafields.json?metafield[owner_id]=51324485704&metafield[owner_resource]=blogs&limit=1

 
But if i use this endpoint:

https://mountbaker.myshopify.com/admin/api/2020-01/blogs/51324485704/metafields.json?limit=1 


The next page_info link have data returned

So for product_images do I have some other endpoint like blog? 
Is this a bug of pagation for metafield?

Accepted Solution (1)

_JB
Shopify Staff
836 100 222

This is an accepted solution.

Hey @hieudion,

I just tried the below URL, and I got the paginated link back as expected:

GET https://mountbaker.myshopify.com/admin/api/2020-01/metafields.json?metafield[owner_id]=18809934476&metafield[owner_resource]=product_images&limit=1

This is from the response headers:

 20-06-7ihha-23ihw

If you're still seeing an issue, kindly confirm how you're making the call, and provide the X-Request-ID value from the response headers of your call. I'll use this to check our logs for more information.

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Reply 1 (1)

_JB
Shopify Staff
836 100 222

This is an accepted solution.

Hey @hieudion,

I just tried the below URL, and I got the paginated link back as expected:

GET https://mountbaker.myshopify.com/admin/api/2020-01/metafields.json?metafield[owner_id]=18809934476&metafield[owner_resource]=product_images&limit=1

This is from the response headers:

 20-06-7ihha-23ihw

If you're still seeing an issue, kindly confirm how you're making the call, and provide the X-Request-ID value from the response headers of your call. I'll use this to check our logs for more information.

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog