To retrieve a list of products along with the media files (video & 3D model) & category

Test72
Shopify Partner
2 0 0

I am running a Get API which is https://<shopUrl>/admin/api/2023-01/products.json in this i am not able to find category and media files as i have uploaded a video along with 3d model.
In response of the above mentioned API i am getting only images.
Please help us in finding media files of the product along with product category.https://<shopUrl>/admin/api/2023-01/products.json 

Replies 2 (2)
Test72
Shopify Partner
2 0 0

We are trying to get media in this form when we are creating or editing product.In this we have added video file and 3D model (glb) and then making the API call to get mediahttps://<shopUrl>/admin/api/2023-01/products.json .But no information on that as we have no variants as if now.

Liam
Shopify Staff
Shopify Staff
1882 202 577

Hi Test72,

So to retrieve a product's media of all types (video, 3D etc) you would use the `media` connection on the Product type, our you could use the Storefront API, where you have access to the `media` field on the Product type to query for a product's media. There's more information on this approach in our developer docs here

Hope this helps!

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog