ShareLink

This endpoint retrieves the share link url for a specific templateHash, is working with generated Templates(variants).

Request

  • Method: GET

  • URL: https://api.creatopy.com/v1beta/shareLink/{{templateHash}}

Request example:

curl --location 'https://api.creatopy.com/v1beta/shareLink/zdow6r' \
--header 'Authorization: Bearer eyJ...'

Response

The response will be a JSON object with the following schema:

JSON

{
    "response": {
        "shareLinkUrl": "https://app.creatopy.com/share/d/5x6ze0x1q6zq",
        "comments": {
            "threads": []
        }
    }
}

This endpoint allows you to generate a preview based on the provided template and element changes.

Request

  • Method: POST

  • URL: https://api.creatopy.com/v1beta/shareLink/generate

  • Body:

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

  • elementsChanges (array, required):

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

    • changes (array, required):

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

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

Response The response for this request is a JSON object following the schema below:

{
  "type": "object",
  "properties": {
    "previewUrl": {
      "type": "string"
    },
    "previewId": {
      "type": "string"
    }
  }
}
curl --location 'https://api.creatopy.local/v1beta/sharelink/generate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ...' \
--data '{
    "templateHash": "2kzq51",
    "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": {
        "shareLinkUrl": "https://app.creatopy.com/share/d/dp7ke1g347o5"
    }
}

Last updated