Creatives

Operations for creatives

Fetch Creatives

POST /v1/networks/creativestable

This is the main endpoint to extract a list of creatives from the API. It’s possible to filter the postbacks returned by this endpoint using search / filters on :

  • The creative’s name (name)
  • The creative’s status (creative_status)
  • The creative’s type (creative_type) : the types can be image, html, thumbnail, email, archive, video, text, link
  • The creative’s offer name (network_offer_name)
  • The creative’s offer id (network_offer_id)

Paging

This endpoint supports paging. Refer to our User Guide for usage.

search_terms object array
search_type string

The name of the field used for search. Can be one of the following values: name, creative_status or creative_type, network_offer_name, network_offer_id. The name option can be used to search with a creative ID as well.

value string

The value to search.

cURL
curl --request POST 'https://api.eflow.team/v1/networks/creativestable' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT PAYLOAD>'

Example 1 : Fetch all active creatives

{
  "search_terms": [
    {
      "search_type": "creative_status",
      "value": "active"
    }
  ]
}

To fetch, for example, the second page of 50 active creatives postbacks you would run the following call :

curl --request POST 'https://api.eflow.team/v1/networks/creativestable?page=2&page_size=50' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '{
  "search_terms": [
    {
      "search_type": "creative_status",
      "value": "active"
    }
  ]
}'

Example 2 : Fetch active creatives linked to offer ID 178

{
  "search_terms": [
    {
      "search_type": "creative_status",
      "value": "active"
    },
    {
      "search_type": "network_offer_id",
      "value": "178"
    }
  ]
}

Example 3 : Fetch creatives with a name that contains the word “Christmas”

{
  "search_terms": [
    {
      "search_type": "network_offer_name",
      "value": "Christmas"
    }
  ]
}

Example 4 : Fetch active creatives of type “email”

{
  "search_terms": [
    {
      "search_type": "creative_status",
      "value": "active"
    },
    {
      "search_type": "creative_type",
      "value": "email"
    }
  ]
}
Response
{
  "creatives": [
    {
      "network_offer_creative_id": 20985,
      "network_id": 1,
      "name": "exemple creative 1",
      "network_offer_id": 5,
      "network_offer_name": "Example Offer CPA",
      "creative_type": "image",
      "is_private": false,
      "creative_status": "active",
      "resource_url": "https://1.efuserassets.com/1/offers/5/c/1234/image.png",
      "html_code": "",
      "width": 300,
      "height": 300,
      "email_from": "",
      "email_subject": "",
      "time_created": 1607093608,
      "time_saved": 1607093608,
      "optimized_thumbnail_url": "https://1.efuserassets.com/thumbnails/1/offers/5/c/1234/image.png"
    }
  ],
  "paging": {
    "page": 1,
    "page_size": 10,
    "total_count": 2
  }
}


Find By ID

GET /v1/networks/creatives/:creativeId

Path Parameters

Parameter Description
creativeId The ID of the creative you want to fetch

cURL
curl --request GET 'https://api.eflow.team/v1/networks/creatives/<INSERT CREATIVE ID>' \
--header 'X-Eflow-API-Key: <INSERT API KEY>'
Response
{
    "network_offer_creative_id": 1,
    "network_id": 1,
    "network_offer_id": 73,
    "name": "test",
    "creative_type": "image",
    "is_private": false,
    "creative_status": "active",
    "resource_url": "https://usercontent-dev.everflowclient.io/1/offers/73/c/1/testcreative.png",
    "html_code": "",
    "width": 0,
    "height": 0,
    "email_from": "",
    "email_subject": "",
    "time_created": 1602865402,
    "time_saved": 1602865403,
    "relationship": {
        "offer": {
            "network_offer_id": 73,
            "network_id": 1,
            "network_advertiser_id": 39,
            "network_offer_group_id": 0,
            "name": "Candy Crush",
            "offer_status": "active",
            "network_tracking_domain_id": 1,
            "visibility": "public",
            "currency_id": "USD"
        },
        "resource_asset": {
            "network_asset_id": 1,
            "content_type": "image/png",
            "filename": "testcreative.png",
            "url": "https://usercontent-dev.everflowclient.io/1/offers/73/c/1/testcreative.png",
            "file_size": 5287,
            "image_width": 0,
            "image_height": 0
        }
    },
    "additional_offer_ids": null,
    "is_apply_specific_affiliates": false
}

Create

POST /v1/networks/creatives

network_offer_id int

Only required when you create a new creative on its own (not part of an offer creation)

name string

Name of the creative.

creative_type string

Type of the creative. Can be one of the following values: image, html, link, thumbnail, email, archive, video or text.

is_private boolean

Whether the creative is accessible by all affiliates.

creative_status string

Status of the creative. Can be either active or deleted.

html_code string

HTML content of the creative. Required only if creative_type is html or email.

width int

Width of the creative. Required only if creative_type is html.

height int

Height of the creative. Required only if creative_type is html.

email_from string

Content of the From field of the email. Required only if creative_type is email.

email_subject string

Content of the Subject field of the email. Required only if creative_type is email.

additional_offer_ids int array

ID of all offer linked to this creative.

is_apply_specific_affiliates boolean

Whether or not you want to apply to specific affiliates. Defaults to false.

resource_file object

Content of the creative. Should only be included if creative_type is image, thumbnail, archive or video.

temp_url string

Temporary URL of the file, obtained by uploading the file through the API.

original_file_name string

Name of the file

html_files object array

List of files attached to the creative. Should only be included if creative_type is html or email.

temp_url string

Temporary URL of the file, obtained by uploading the file through the API.

original_file_name string

Name of the file, which will be the used to generate the file macro. For example, Example File Name will give the macro {{example_file_name}}.

html_assets object array
content_type string

The type of content in the asset. //NOT SURE

filename string

Name of the file.

url string

URL of the file, obtained by uploading the file through the API.

file_size int

Size of the file.

image_width int

Width of the creative. Required only if creative_type is image.

image_height int

Height of the creative. Required only if creative_type is image.

{
    "network_offer_id": 73,
    "name": "",
    "creative_type": "image",
    "is_private": false,
    "creative_status": "active",
    "html_code": "",
    "width": 0,
    "height": 0,
    "email_from": "",
    "email_subject": "",
    "additional_offer_ids": [],
    "is_apply_specific_affiliates": false,
    "resource_file":
    {
        "temp_url": "https://usercontent-dev.everflowclient.io/1/temp/30e093f3-54bd-445f-9afb-291e506af466",
        "original_file_name": "original_name"
    },
    "html_files": [
    {
        "temp_url": "",
        "original_file_name": ""
    }],
    "html_assets": [
    {
        "content_type": "",
        "filename": "",
        "url": "",
        "file_size": 0,
        "image_width": 0,
        "image_height": 0
    }]
}

cURL
curl --request POST \
  --url 'https://api.eflow.team/v1/networks/creatives' \
  --header 'x-eflow-api-key: <INSERT API KEY>' \
  --header 'content-type: application/json' \
  --data '<INSERT PAYLOAD>'
Response
{
    "network_offer_creative_id": 10,
    "network_id": 1,
    "network_offer_id": 73,
    "name": "",
    "creative_type": "image",
    "is_private": false,
    "creative_status": "active",
    "resource_url": "https://usercontent-dev.everflowclient.io/1/offers/73/c/10/original_name",
    "html_code": "",
    "width": 0,
    "height": 0,
    "email_from": "",
    "email_subject": "",
    "time_created": 1603890208,
    "time_saved": 1603890209,
    "relationship": {
        "offer": {
            "network_offer_id": 73,
            "network_id": 1,
            "network_advertiser_id": 39,
            "network_offer_group_id": 0,
            "name": "Candy Crush",
            "offer_status": "active",
            "network_tracking_domain_id": 1,
            "visibility": "public",
            "currency_id": "USD"
        },
        "resource_asset": {
            "network_asset_id": 7,
            "content_type": "image/gif",
            "filename": "original_name",
            "url": "https://usercontent-dev.everflowclient.io/1/offers/73/c/10/original_name",
            "file_size": 6,
            "image_width": 0,
            "image_height": 0
        }
    },
    "additional_offer_ids": null,
    "is_apply_specific_affiliates": false
}

Update

PUT /v1/networks/creatives/:creativeId

You must specify all the fields, not only the ones you wish to update.
If you omit a field that is not marked as required, its default value will be used.

Path Parameters

Parameter Description
creativeId The ID of the creative you want to update

network_offer_id int

Only required when you create a new creative on its own (not part of an offer creation)

name string

Name of the creative.

creative_type string

Type of the creative. Can be one of the following values: image, html, thumbnail, email, archive, video or text.

is_private boolean

Whether the creative is accessible by all affiliates.

creative_status string

Status of the creative. Can be either active or deleted.

html_code string

HTML content of the creative. Required only if creative_type is html or email.

width int

Width of the creative. Required only if creative_type is html.

height int

Height of the creative. Required only if creative_type is html.

email_from string

Content of the From field of the email. Required only if creative_type is email.

email_subject string

Content of the Subject field of the email. Required only if creative_type is email.

additional_offer_ids int array

ID of all offer linked to this creative.

is_apply_specific_affiliates boolean

Whether or not you want to apply to specific affiliates. Defaults to false.

resource_file object

Content of the creative. Should only be included if creative_type is image, thumbnail, archive or video.

temp_url string

Temporary URL of the file, obtained by uploading the file through the API.

original_file_name string

Name of the file

html_files object array

List of files attached to the creative. Should only be included if creative_type is html or email.

temp_url string

Temporary URL of the file, obtained by uploading the file through the API.

original_file_name string

Name of the file, which will be the used to generate the file macro. For example, Example File Name will give the macro {{example_file_name}}.

html_assets object array
content_type string

The type of content in the asset. //NOT SURE

filename string

Name of the file.

url string

URL of the file, obtained by uploading the file through the API.

file_size int

Size of the file.

image_width int

Width of the creative. Required only if creative_type is image.

image_height int

Height of the creative. Required only if creative_type is image.

{
    "network_offer_id": 73,
    "name": "",
    "creative_type": "image",
    "is_private": false,
    "creative_status": "active",
    "html_code": "",
    "width": 0,
    "height": 0,
    "email_from": "",
    "email_subject": "",
    "additional_offer_ids": [],
    "is_apply_specific_affiliates": false,
    "resource_file":
    {
        "temp_url": "https://usercontent-dev.everflowclient.io/1/temp/30e093f3-54bd-445f-9afb-291e506af466",
        "original_file_name": "original_name"
    },
    "html_files": [
    {
        "temp_url": "",
        "original_file_name": ""
    }],
    "html_assets": [
    {
        "content_type": "",
        "filename": "",
        "url": "",
        "file_size": 0,
        "image_width": 0,
        "image_height": 0
    }]
}

cURL
curl --request PUT \
  --url 'https://api.eflow.team/v1/networks/creatives/<INSERT CREATIVE ID>' \
  --header 'x-eflow-api-key: <INSERT API KEY>' \
  --header 'content-type: application/json' \
  --data '<INSERT PAYLOAD>'
Response
{
    "network_offer_creative_id": 10,
    "network_id": 1,
    "network_offer_id": 73,
    "name": "",
    "creative_type": "image",
    "is_private": false,
    "creative_status": "active",
    "resource_url": "https://usercontent-dev.everflowclient.io/1/offers/73/c/10/original_name",
    "html_code": "",
    "width": 0,
    "height": 0,
    "email_from": "",
    "email_subject": "",
    "time_created": 1603890208,
    "time_saved": 1603890209,
    "relationship": {
        "offer": {
            "network_offer_id": 73,
            "network_id": 1,
            "network_advertiser_id": 39,
            "network_offer_group_id": 0,
            "name": "Candy Crush",
            "offer_status": "active",
            "network_tracking_domain_id": 1,
            "visibility": "public",
            "currency_id": "USD"
        },
        "resource_asset": {
            "network_asset_id": 7,
            "content_type": "image/gif",
            "filename": "original_name",
            "url": "https://usercontent-dev.everflowclient.io/1/offers/73/c/10/original_name",
            "file_size": 6,
            "image_width": 0,
            "image_height": 0
        }
    },
    "additional_offer_ids": null,
    "is_apply_specific_affiliates": false
}

Bulk Edit

PATCH /v1/networks/patch/offers/creative/apply

This endpoint allows you to update selected fields of one or multiple creatives at the same time. It does not require the entire creative object to be passed in the payload. Only the properties that need to be changed must be supplied.

Body Param

network_offer_creative_ids int array

IDs of the creatives to be patched.

fields object array

List of fields to patch. See here for the list of types and their corresponding values.

field_type string

Type of the field to patch. See here for the list of types.

field_value

Value of the field to patch. See here for the list of values.

operator string

Operator determining how the field will be used to modify the creatives. For the fields that are currently patchable, this will always be overwrite.

Body Example

{
    "network_offer_creative_ids":
    [
        1, 
        3
    ],
    "fields":
    [
        {
            "field_type": "creative_status",
            "field_value": "paused",
            "operator": "overwrite"
        },
        {
            "field_type": "name",
            "field_value": "New Patched Name",
            "operator": "overwrite"
        },
        {
            "field_type": "is_private",
            "field_value": true,
            "operator": "overwrite"
        }
    ]
}

cURL
curl --request PATCH 'https://api.eflow.team/v1/networks/patch/offers/creative/apply' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT BODY HERE>'

Example 1 : Pause multiple creatives at the same time :

{
    "network_offer_creative_ids": [
        3,
        12
    ],
    "fields": [
        {
            "field_type": "creative_status",
            "field_value": "paused",
            "operator": "overwrite"
        }
    ]
}
Response
{
  "result": true
}

Patchable Fields

The fields below are to be used in the Bulk Edit and Patch Preview endpoints documented above.

name string

The name of the creative

is_private bool

Determines whether a creative is visible to partners or not.

creative_status string

The status of the creative. Can be active, paused or deleted