Working with product media (create product video)

Tourist
21 0 2

Hello everyone ! I start work with product media API and productCreateMedia requests. I try to use productCreateMedia with graphic but all attempts were unsuccessful with status code 404.  

 

My query is: 

 

`
  productCreateMedia($id: ID!, $media: [CreateMediaInput!]!) {
    productCreateMedia(productId: $id, media: $media) {
      media {
        id
        alt
        mediaContentType
        position
        previewImage {
          id
        }
        status
        mediaErrors {
          code
          details
          message
        }
      }
      product {
        id
      }
      userErrors {
        field
        message
      }
    }
  }
`
const variables = {
  id: "gid://shopify/Product/4181879717973",
  media: [
    {
      originalSource:
        "https://animatron-test-library.s3.amazonaws.com/templates/5024dc5bd6049065f9023e15/facebook_square_hd720.mp4",
      alt: "video alt ",
      mediaContentType: "VIDEO"
    }
  ]
};

 

Thanks for any help and suggestions! 

0 Likes
Excursionist
15 0 4

Hey @Viktor10 

Make sure you are sending these requests to the unstable version of the GraphQL API as it's still not officially released.
https://{{ store }}.myshopify.com/admin/api/unstable/graphql.json

0 Likes
Tourist
21 0 2

I tried to make an unstable request but got next error

Screen Shot 2019-10-11 at 1.55.37 PM.png

0 Likes
New Member
5 0 0

From the documents:

To test using product media in the Shopify admin, create a development store and enable a developer preview from your Partner Dashboard.

 

maybe your development store not enable the developer preview

0 Likes