Exports

Export Templates

This endpoint allows you to export templates by making an HTTP POST request. This endpoint will also create a new design with the requested element changes.

Request

  • Method: POST

  • Endpoint: https://api.creatopy.com/v1/export-with-changes

  • Body:

    • templateHash (string): The hash of the creative.

    • type (string): The type of export.

    • exportSettings (object): Settings for the export

      • quality (int): HTML specific param.

      • gifPreset (enum): GIF specific param.

      • networkId (int): HTML specific param.

      • pdfPreset (enum): Pdf specific param (PDF_STANDARD and PDF_PRINT)

      • slide (array of int): PDF specific param (the slide number to export, starts from 0 (for the first slide))

    • webhookUrl (string): Webhook URL that will be called when the export completes (succeed or fails)

    • elementsChanges (array):

      • elementName (string): The name of the element.

      • changes (array):

        • attribute (string): The attribute to be changed.

        • value (string): The new value for the attribute.

curl --location 'https://api.creatopy.com/v1/templates/export' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ...' \
--data '{
    "creativeHash": "zdow6r",
    "type": "jpg",
    "elementsChanges": [
        {
            "elementName": "Headline",
            "changes": [
                {
                    "attribute": "LABEL",
                    "value": "Enjoy a $0 annual \nfee and 1.5% \n cashback on purchases"
                }
            ]
        },
        {
            "elementName": "Description",
            "changes": [
                {
                    "attribute": "LABEL",
                    "value": "Plus, earn a $300 bonus"
                }
            ]
        },
        {
            "elementName": "Logo",
            "changes": [
                {
                    "attribute": "SOURCE",
                    "value": "https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/eff.svg"
                }
            ]
        },
        {
            "elementName": "shape2",
            "changes": [
                {
                    "attribute": "SOURCE",
                    "value": "https://cdn.pixabay.com/photo/2012/04/24/16/43/targets-40383_1280.png"
                }
            ]
        },
        {
            "elementName": "Image",
            "changes": [
                {
                    "attribute": "SOURCE",
                    "value": "https://cdn.pixabay.com/photo/2012/04/24/16/43/targets-40383_1280.png"
                }
            ]
        }
    ]
}'

Response

The response to this request is a JSON schema:

Response example
{
    "response": {
        "export": {
            "id": "b46adaed-39df-41a2-89e5-beb870282414", 
            "type": "jpg",
            "status": "pending",
            "errorLog": null,
            "creatives": [
                {
                    "id": "fc188412-c614-4db7-b611-f725e73cb36d",
                    "status": "pending",
                    "url": null
                },
                {
                    "id": "954dad76-6dd9-4a79-ac09-26da6bceeb96",
                    "status": "pending",
                    "url": null
                }
            ]
        }
    }
}

With the export ID we will check the status of the export

Export existing design

This endpoint allows you to export existing designs by making an HTTP POST request. This endpoint will not create a new design.

Request

  • Method: POST

  • Endpoint: https://api.creatopy.com/v1/export

  • Body:

    • creativeHash (string): The hash of the creative.

    • type (string): The type of export.

    • exportSettings (object): Settings for the export

      • quality (int): HTML specific param.

      • gifPreset (enum): GIF specific param.

      • networkId (int): HTML specific param.

      • pdfPreset (enum): Pdf specific param (PDF_STANDARD and PDF_PRINT)

      • slide (array of int): PDF specific param (the slide number to export, starts from 0 (for the first slide))

    • webhookUrl (string): Webhook URL that will be called when the export completes (succeed or fails)

curl --location 'https://api.creatopy.com/v1/export' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ...' \
--data '{
    "creativeHash": "zdow6r",
    "type": "jpg",
}'

Response

The response to this request is a JSON schema:

Response example
{
    "response": {
        "export": {
            "id": "b46adaed-39df-41a2-89e5-beb870282414", 
            "type": "jpg",
            "status": "pending",
            "errorLog": null,
            "creatives": [
                {
                    "id": "fc188412-c614-4db7-b611-f725e73cb36d",
                    "status": "pending",
                    "url": null
                },
                {
                    "id": "954dad76-6dd9-4a79-ac09-26da6bceeb96",
                    "status": "pending",
                    "url": null
                }
            ]
        }
    }
}

With the export ID we will check the status of the export

Check Export Status

This endpoint retrieves the export data with the specified ID.

Request

  • Method: GET

  • URL: https://api.creatopy.com/v1/export/b46adaed-39df-41a2-89e5-beb870282414

Response

  • Status: 200

  • Content-Type: application/json

Response example
{
    "response": {
        "id": "b46adaed-39df-41a2-89e5-beb870282414",
        "type": "jpg",
        "status": "complete",
        "errorLog": null,
        "creatives": [
            {
                "status": "complete",
                "url": "https://creatopy-api-0d4e56b.s3.eu-central-1.amazonaws.com/creatives/b46adaed-39df-41a2-89e5-beb870282414/fc188412-c614-4db7-b611-f725e73cb36d?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASCU4ALRBL5EQ3KHE%2F20240911%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20240911T072944Z&X-Amz-Expires=3600&X-Amz-Signature=6739d8a7f2f70b7a518c510eb10ebcbcd82fe57dec1a0c335df473257229562e&X-Amz-SignedHeaders=host",
                "id": "fc188412-c614-4db7-b611-f725e73cb36d"
            },
            {
                "status": "complete",
                "url": "https://creatopy-api-0d4e56b.s3.eu-central-1.amazonaws.com/creatives/b46adaed-39df-41a2-89e5-beb870282414/954dad76-6dd9-4a79-ac09-26da6bceeb96?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASCU4ALRBL5EQ3KHE%2F20240911%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20240911T072944Z&X-Amz-Expires=3600&X-Amz-Signature=bfd48ac7717f9f4cedf60aa5d3ca0f2dbf55ec202bf8ac9829465756450489ef&X-Amz-SignedHeaders=host",
                "id": "954dad76-6dd9-4a79-ac09-26da6bceeb96"
            }
        ]
    }
}

Creatives

Last updated