POST
/
partners
/
assets
curl --location 'https://api.gotolstoy.com/partners/assets' \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
  "assets": [
    {
      "externalId": "1",
      "videoUrl": "https://cdn.shopify.com/video.mp4",
      "posterUrl": "https://cdn.shopify.com/image.jpg",
      "shopId": "gid://shopify/Shop/123",
      "appUrl: "tolstoy.myshopify.com",
      "products": [
        {"id": "gid://shopify/Product/1", "title": "Product title", "imageUrls": https://test.myshopify.com/81f3345adfd6.jpg"]},
        {"id": "gid://shopify/Product/2"}
      ]
    }
  ]
}'
{
  "newAssetsCount": 1,
  "userErrors": []
}

Parameters

assets
Asset[]
required

The list of assets to store

Asset structure

type Asset = {
  externalId: string;
  videoUrl: string;
  posterUrl: string;
  shopId: string;
  products: Product[];
  appUrl: string;
};

type Product = {
  id: string;
  title?: string;
  imageUrls?: string[];
};

Example

{
  "externalId": "1",
  "videoUrl": "https://cdn.shopify.com/video.mp4",
  // video preview image (must be hosted on Shopify cdn)
  "posterUrl": "https://cdn.shopify.com/image.jpg",
  // Shopify store id
  "shopId": "gid://shopify/Shop/123",
  // store MyShopify domain
  "appUrl": "tolstoy.myshopify.com",
  // a list of products linked to the video
  "products": [
    {
      // Shopify product id (required)
      "id": "gid://shopify/Product/1",
      // product title (optional)
      "title": "Product title",
      // an array of product images (optional)
      "imageUrls": ["https://test.myshopify.com/81f3345adfd6.jpg"]
    }
  ]
}