Pulling product media into a site using Storefront API. Images great, but videos expire?

roowilliams
New Member
3 0 0

Hello,

I'm pulling in images and videos from product media to my store site via the Storefront API.

I noticed after a few days my videos stopped displaying, visiting the video URL gives a 403: forbidden and then I noticed the URL for my videos contain an 'Expires' parameter:

 

 

 

https://videos.shopifycdn.com/c/vp/2c2ac8de872b46b98c092e16b84697ea/2c2ac8de872b46b98c092e16b84697ea.SD-480p-1.5Mbps.mp4?Expires=1599502331&KeyName=core-signing-key-1&Signature=mQBe6xF2yldjimR4_P8_D6VmsnI=

 

 

 

How should we source videos using the Storefront API? Am I missing something?

Here's an extract of the query I am using, and below the part that is returned that I use to get the video URL.

 

 

    query GetProducts($first: Int!, $after: String) {
            products(first: $first, after: $after) {
              pageInfo {
                hasNextPage
              }
              edges {
                cursor
                node {
                  availableForSale
                  createdAt
                  description
                  descriptionHtml
                  handle
                  id
                  images(first: 250) {
                    edges {
                      node {
                        id
                        altText
                        originalSrc
                      }
                    }
                  }
                  media(first: 250) {
                    edges {
                      node {
                        alt
                        mediaContentType
                        ... on Video {
                          id
                          sources {
                          format
                          height
                          mimeType
                          url
                          width
                        }
                      }
                        previewImage {
                          id
                          originalSrc
                          transformedSrc
                        }
                      }
                    }
                  }

 

 

   "node": {
                    "id": "Z2lkOi8vc2hvcGlmeS9WaWRlby8xMTAwMTMyOTcxMzMwMg==",
                    "mediaContentType": "VIDEO",
                    "sources": [
                      {
                        "url": "https://videos.shopifycdn.com/c/vp/2c2ac8de872b46b98c092e16b84697ea/2c2ac8de872b46b98c092e16b84697ea.SD-480p-1.5Mbps.mp4?Expires=1599502331&KeyName=core-signing-key-1&Signature=mQBe6xF2yldjimR4_P8_D6VmsnI="
                      }
                    ]
                  }

Thanks

Roo

0 Likes