Add an Asset

Create an asset and add it to the Einstein Content Selection asset pool. Asset class or type, and custom attributes are created implicitly if they don’t exist.

Method and Endpoint

POST "/ecs/ecs/external/api/v1/asset"

Request Body Parameters

Name Type Description
availability string, enum Required. Set whether the asset can be selected. Possible values are: Y, N
content_builder_id string, Content Builder ID Instead of loading the image from a hosted URL or Data URL, create an image for this asset using HTML from the specified Content Builder item.
custom map, string → string The Asset Attributes to associate with this asset. New Attributes are created implicity if they don't exist. For example: locale: JP and segment: A3
display_time_zone string The timezone to show in-app timestamps for this asset. For example: UTC, Eastern Time (US & Canada)
end_datetime datetime, ISO-8601 The date and time the asset is no longer allowed to be selected. For example: 2021-07-23T13:45:15Z
fallback string, enum Set whether the asset can be selected as a fallback when rules disqualify all other content. Possible values are: Y, N
image_url string, URL, data URL Required. Can be either a web-accessible URL hosting an image or a base-64 encoded Data URL containing image data.
key string Required. The asset's name. Must be unique to the account.
start_datetime datetime, ISO-8601 The start date and time the asset is allowed to be selected. For example: 2021-06-23T13:45:15Z
type string Required. Name of the asset's asset_class.
url string, URL The redirect link to use when an asset is clicked.

Example Request

POST "/ecs/ecs/external/api/v1/asset"

BODY:
{
    "key": "Einstein Content",
    "type": "Icon",
    "availability": "Y",
    "fallback": "N",
    "start_datetime": "2021-06-23T00:00:00Z",
    "end_datetime": "2221-06-23T23:59:59Z",
    "display_time_zone": "Osaka",
    "url": "https://www.example.com/einstein-content",
    "custom": { "locale": "JP" },
    "image_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAAAXNSR0IArs4c6QAACJBJREFUaAXtWn1sHEcVn7d7Pn8kcMRJSgkgaCoQLQ1pVRAhCiRqQSpV2ioqjWigFQXUUPk+9i6OE0soWG1JwjX23dm+SlAhGlGRJuUPSosErRBEIqBSSptIFc0/2H+gpGpiJ07l5Hx3O8Pvnb32er23d3s5Ly4w0mVm3nsz7/32vTdfMQmUnp7YR4pTKk1CbFFKfYhpS6UQ0VklxB/DrdSTT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BTFo1rzzi2C15tG/vhOrdcV6Q8brnVtR7MZkcB6vycBP3m/StWHp7rT7dcY9gp1Iw+HpW2VnZej8lSRhTvphTO5Ib4oF8pfIYlWT6qkx49lMudsuiVWhHyU1VeDJCPO/Byx4ATdpnAPLhh4+Y06eGbdE3bQaT9CKH5mt0QbkspHsK/+M0VTZU3YWv5YlmZd8xRZ1pkXa/oDLLth1pI+7FTJjAPbt++3YTyN2d+R9iQ3YZxMwzfxu2ZwiEWtjpch1rFiVJB/JlC9Ds7ndsAfhFJtu+GG9Yd3rlzZ0MPw845F72PUCO7EqyuHZXbiJ0402aeC3kead5k8zgBd3p7Y6sLl9WzULsJrvkHYJ7EcXk9vLQeS/8VLEa7s9l83q9ZgeVgLcOmJsV+3vzxCzMorLgPVmoMBK1dSOqHxzyfNNx0LBmAktT73Ayco6lWIcbm5eccr3pryQDUhHqmuplYI4me6+sbuuQl48ZbMgAHcvkXW4T+SWwln9AEDWEbGcFGvj8UprVhreVGHOd2uAH4n6f9GydjfCNTHqEaAAAAAElFTkSuQmCC"
}

Example Response

CODE: 201 CREATED

BODY:
{
    "key": "Einstein Content",
    "uuid": "cf868607-9eec-4e2b-ae87-3d2ca7ed7911",
    "type": "Icon",
    "url": "https://www.example.com/einstein-content",
    "image_url": null,
    "custom": {
        "locale": "JP"
    },
    "created_at": "2021-08-02T22:20:52.861Z",
    "updated_at": "2021-08-02T22:20:53.215Z",
    "availability": "Y",
    "fallback": "N",
    "file_ext": "png",
    "status": "ready",
    "image_updated_at": "2021-08-02T22:20:53.162Z",
    "image_processing_completed_at": "2021-08-02T22:20:53.211Z",
    "image_checksum": "1dc357753245e9b30fa20dde079734f9-1",
    "asset_class_id": "de8f1883-5dec-4793-917f-3ca95306528c",
    "content_builder_id": null,
    "archived": false,
    "ect_tags": null,
    "start_datetime": "2021-06-23T00:00:00.000Z",
    "end_datetime": "2221-06-23T23:59:59.000Z",
    "display_time_zone": "Osaka",
    "image_link": "https://ecs-asset-images-qa.s3.us-west-2.amazonaws.com/3612/21575198/f/cf868607-9eec-4e2b-ae87-3d2ca7ed7911.png?v=1dc357753245e9b30fa20dde079734f9-1",
    "display_time_zone_name": "Asia/Tokyo",
    "display_start_datetime": "2021-06-23T09:00:00+09:00",
    "display_end_datetime": "2221-06-24T08:59:59+09:00"
}