Dynamic Mockups API
  • ๐Ÿ”‘Get your API Key
  • ๐Ÿ‘‹Get support via Slack
  • ๐Ÿš€Get your first render in 1 minute
  • Getting Started
    • How does the API work?
    • How can I get my API key?
    • How are API calls billed?
    • How can I get support?
    • Frequently Asked Questions
    • Troubleshooting
  • API REFERENCE
    • Render API
    • Get Mockups API
    • Get Collections API
    • PSD Upload API
  • PRODUCT API REFERENCE
    • Render Product Images API
    • Get Products API
  • Mockup Editor SDK
    • Embed Mockup Editor
    • Embed in bubble.io
    • Editor Configuration
  • Knowledge Base
    • Tutorials
      • PSD Formatting Guide for Uploading to Dynamic Mockups
      • How to provide image link from Google Drive to Render API
      • How to render images using Zapier
      • How to render images using Make
    • Changelog
    • Photoshop API Feature Support
Powered by GitBook
On this page

Was this helpful?

  1. PRODUCT API REFERENCE

Render Product Images API

PreviousPSD Upload APINextGet Products API

Last updated 4 days ago

Was this helpful?

product_uuid

To get the images of a specific product, you need to target a specific product using the product_uuid parameter.

template_group_uuid

You may add more template groups inside a product.

Template groups allow you to have more template styles per product, for example: Summer photoshoot session, Winter photoshoot session.

Easily switch between template groups you are rendering per API call by targeting their template_group_uuid.

artworks

Provided artworks can be attached to any template from a targeted template group.

This is what we call template groups mapping.

You can create any number of artwork inputs and attach them to any template from the template group and its smart objects.

From this image example, artwork_main will be used in the Render Product Images API

The request would look something like this:

{
    "product_uuid": "9a4bcbc5-f37a-4e96-a45e-d34341e6980a",
    "template_group_uuid": "0663101b-f01c-4e85-89af-f90b4e9f983b",
    "artworks": {
        "artwork_main": "https://app-dynamicmockups-production.s3.eu-central-1.amazonaws.com/static/api_sandbox_icon.png"
    }
}

You can provide any number of artworks, you can name them as you want. And you can do something like this:

{
    "product_uuid": "9a4bcbc5-f37a-4e96-a45e-d34341e6980a",
    "template_group_uuid": "0663101b-f01c-4e85-89af-f90b4e9f983b",
    "artworks": {
        "artwork_main": "https://app-dynamicmockups-production.s3.eu-central-1.amazonaws.com/static/api_sandbox_icon.png",
        "artwork_secondary": "https://app-dynamicmockups-production.s3.eu-central-1.amazonaws.com/static/api_sandbox_icon.png",
        //add any number of artworks needed
    }
}

The number of artworks could potentially slow the rendering performance. The fewer artworks used, the faster the response.

Send artwork as a binary file instead of a URL

In some cases, you will want to send the binary file instead of the URL.

When sending a binary file in an API request, you must use FormData instead of sending the file as part of a JSON payload. This is because binary files cannot be directly represented in JSON format.

In this example, instead of:

"artwork_main": "https://app-dynamicmockups-production.s3.eu-central-1.amazonaws.com/static/api_sandbox_icon.png",

Send a binary file artwork_main using FormData

When sending FormData, you don't need to send all the artworks as binary files; you can send a combination of URLs and binary files if needed.

In the case above, artwork_main could be sent as a binary file, but artwork_secondary can still be sent as a URL.

The image must be one of the following extensions: jpg, jpeg, png, webp, gif

colors

Besides artworks, you can also attach colors.

From this image example, we've added color_main only to the last template in a template group because we want to apply the color only to that template image when getting the rendered images.

The request would look something like this:

{
    "product_uuid": "9a4bcbc5-f37a-4e96-a45e-d34341e6980a",
    "template_group_uuid": "0663101b-f01c-4e85-89af-f90b4e9f983b",
    "artworks": {
        "artwork_main": "https://app-dynamicmockups-production.s3.eu-central-1.amazonaws.com/static/api_sandbox_icon.png"
    },
    "colors": {
        "color_main": "#C0375E"
    }
}

As we created our flow while mapping, this color will only be attached to the last template. The first and the second templates will only get the provided artwork_main .

export_label

When defining this optional parameter in your request, the response will return the same value.

This parameter is used to help recognize the request you sent with the label.

export_options.image_format

By default, all the images are returned in PNG format.

But sometimes, for example, you want to get more optimized images for the web.

By providing some of the following values: jpg, png, webp you can control what image format you want from our API.

export_options.image_size

Same as image_format, you can tell our API if you need images of a specific size.

All the images will be returned in high resolution, but sometimes you need smaller ones.

Provide export_options.image_size = 720 to get images with a 720px width.

The provided value will define the image's width. The height will auto-scale.

export_options.mode

Our API exports images as binary by default, causing the browser to download them automatically.

To display the images in the browser instead of downloading it, set export_options.mode = "view".

Copy specific product uuid
Copy product uuidresponse will return the same value
Map artworks to templates
Map colors to templates
  • POSTRender images for a specific product
  • product_uuid
  • template_group_uuid
  • artworks
  • colors
  • export_label
  • export_options.image_format
  • export_options.image_size
  • export_options.mode

Render images for a specific product

post
Authorizations
Body
product_uuidstring ยท uuidRequiredExample: e3a9a550-42f1-4cbe-bc33-24b859a13467
template_group_uuidstring ยท uuidRequiredExample: 4f21ac10-67ff-42f4-9362-84a7498c8a9b
colorsobjectOptional

Key-value map of color inputs using hex codes

Example: {"color_primary":"#FF5733"}
export_labelstringOptionalExample: fall_collection_render
Responses
200
Successful render of product images
application/json
400
Bad request due to invalid input parameters
401
Unauthorized request, invalid or missing API key
403
Insufficient credits to perform this action
422
Missing required input parameters
post
POST /api/v1/products/render HTTP/1.1
Host: app.dynamicmockups.com
X-Api-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 337

{
  "product_uuid": "e3a9a550-42f1-4cbe-bc33-24b859a13467",
  "template_group_uuid": "4f21ac10-67ff-42f4-9362-84a7498c8a9b",
  "artworks": {
    "artwork_main": "https://cdn.example.com/artworks/logo.png"
  },
  "colors": {
    "color_primary": "#FF5733"
  },
  "export_label": "fall_collection_render",
  "export_options": {
    "image_format": "webp",
    "image_size": 360,
    "mode": "view"
  }
}
{
  "success": true,
  "message": "",
  "data": {
    "export_label": "fall_collection_render",
    "exports": [
      {
        "url": "https://cdn.example.com/exports/rendered_image_01.webp",
        "label": "Modern-Living-Room-Frame"
      },
      {
        "url": "https://cdn.example.com/exports/rendered_image_02.webp",
        "label": "Bright-Studio-Canvas-Display"
      }
    ]
  }
}