Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Pagination for product images metafields

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 (Retired)
836 100 223

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 (Retired)
836 100 223

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