Solved

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

Hgolov
Shopify Partner
26 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!

Accepted Solution (1)
olivert
Explorer
51 12 19

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!)

 

 

View solution in original post

Replies 5 (5)

Gregarican
Shopify Partner
1033 86 285

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.

Hgolov
Shopify Partner
26 0 2

Thanks @Gregarican & @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.

olivert
Explorer
51 12 19

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!)

 

 

olivert
Explorer
51 12 19

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.

vikfromlevar
Shopify Expert
25 0 2

Hello - a late reply, but this might be the answer you're looking for. 

 

Our Shopify App  lets you host 3D models on any theme (desktop/mobile) with the ability to kick-out to mobile Augmented Reality. I'd be happy to offer discounted hosting and 3D asset creation, you can learn more here

 

-Vik

See how Augmented Reality from levAR can help your business drive sales, reduce returns and increase brand awareness.

levar.io