How to add media (videos, 3D) to products via API

Solved
Highlighted
Shopify Partner
23 0 2

Hi,

I've updated my client's theme to display videos in the product gallery - both in the main display and the thumbnails. However, I can't find any documentation as to how to add video or 3D image urls via the REST API. I know I can go into each product individually, but that's not going to work at scale. Please help!

0 Likes
Highlighted
Shopify Partner
593 41 118

You can utilize the REST API to hit the Asset endpoint I believe --> https://shopify.dev/docs/admin-api/rest/reference/online-store/asset That is one option.

0 Likes
Highlighted
Explorer
41 10 11

Hi Mate

If your videos are stored on vimeo or YouTube etc.

You can store the video url as a metafield against the product then change your theme to look at that metafield for the video source.

It's really nice to automate It this way.

0 Likes
Highlighted
Shopify Partner
23 0 2

Thanks @Greg_Kujawa & @olivert - the thing is I'm referring to Shopify's newly native support of videos & 3D photography.

See this post for more information:

https://www.shopify.com/partners/blog/product-media

I don't see any support for adding this type of media by rest.

0 Likes
Highlighted
Explorer
41 10 11

This is an accepted solution.

Ah yes sorry mate

Yep the REST API is very limited in some places you can't do this with REST

You'll have to jump on GraphQL to get the job done

 If you 100% must use REST then you can add the url to a metafield and do it that way

You've probably already seen this but:

https://shopify.dev/tutorials/manage-product-media-with-admin-api

Bottom of the page they say it's unavailable with REST. (Boo!)

 

 

0 Likes
Highlighted
Tourist
8 0 1

Hi, please visit our site sales@madeinply.co.uk as an example. I’m just about to launch a new business called parametric 3d which will offer these services. Please get in touch if your interested 

0 Likes