Skip to main content
POST
/
cms
/
banners
/
v2
cURL
curl --request POST \
  --url https://api.mottostreaming.com/cms/banners/v2 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "project_id": "<string>",
  "name": "<string>",
  "banner_type": "BANNER_TYPE_UNSPECIFIED",
  "template_type": "<string>",
  "content_id": "<string>",
  "dynamic_target": {
    "filter": "<string>",
    "order_by": "<string>"
  },
  "background_assets": [
    {
      "options": [
        {
          "asset_id": {
            "asset_id": {}
          },
          "keypath": "<string>"
        }
      ],
      "breakpoint_width": 123
    }
  ],
  "data": {},
  "environments": [
    "<string>"
  ],
  "css_classes": [
    "<string>"
  ],
  "visibility": "VISIBILITY_UNSPECIFIED",
  "overrides": {},
  "geo_applicability_exempt": {
    "country_codes": [
      "<string>"
    ]
  },
  "geo_applicability_apply": {
    "country_codes": [
      "<string>"
    ]
  },
  "destination_url": {}
}
'
{
  "banner": {
    "project_id": "<string>",
    "name": "<string>",
    "banner_type": "BANNER_TYPE_UNSPECIFIED",
    "template_type": "<string>",
    "id": "<string>",
    "content_id": "<string>",
    "dynamic_target": {
      "filter": "<string>",
      "order_by": "<string>"
    },
    "background_assets": [
      {
        "options": [
          {
            "asset_id": {
              "asset_id": {}
            },
            "keypath": "<string>"
          }
        ],
        "breakpoint_width": 123
      }
    ],
    "data": {},
    "environments": [
      "<string>"
    ],
    "css_classes": [
      "<string>"
    ],
    "visibility": "VISIBILITY_UNSPECIFIED",
    "overrides": {},
    "geo_applicability_exempt": {
      "country_codes": [
        "<string>"
      ]
    },
    "geo_applicability_apply": {
      "country_codes": [
        "<string>"
      ]
    },
    "destination_url": {}
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Banner represents a single banner that can be displayed on an end-user facing web/app page. Banners can be either static (with fixed content) or dynamic (content derived from parameters).

project_id
string
required
name
string
required

A name for visual identification within the management UI. Does not appear towards end users.

banner_type
enum<string>
required

The type of banner that determines how content is sourced.

Available options:
BANNER_TYPE_UNSPECIFIED,
BANNER_TYPE_DEFAULT,
BANNER_TYPE_EVENT,
BANNER_TYPE_CREATIVE_WORK,
BANNER_TYPE_ENTITY
template_type
string
required

The type of template that should be rendered. Refer to the documentation to find the available types. Examples: "team-vs-team-hero", "simple", "video-bg", "highlighted-event", etc.

content_id
string

Single banner - it is connected to a single content item (either an event, entity, or creative work).

dynamic_target
object

Dynamic banner - it is not connected to a single content item, but derives its content from a set of filters.

background_assets
object[]

A list of assets to be shown in the background (as the main banner image). Each asset is meant for a different screen size, determined by its breakpoint_width property. E.g. if you only want a single asset for this banner, you can set breakpoint_width to 0. E.g. if you want to show a different asset for mobile vs desktop, you can set breakpoint_width to 0 for the mobile asset and 1024 for the desktop asset.

data
object

Data needed by individual templates. Each template can have its own data structure. Refer to the documentation for the specific template to see what data is needed. To reference properties of the connected content item, use variable keypaths like {event.title}, {entity.name}, {event.fields.competition.item.banner} etc.

environments
string[]

The environments in which this banner should be rendered. The available options are: "web", "ios", "android", "tvos", "lg", "samsung", "androidtv"

Important: this should always be a subset of the environments configured at the page-component level for the associated banner collection. For example, if a page component is configured to be "ios" only, but a banner inside that component has "web" only, that banner will never be shown.

css_classes
string[]

Web only. A list of CSS classes that should be added to the banner's container element. This can be used to apply custom styling to the banner.

visibility
enum<string>
Available options:
VISIBILITY_UNSPECIFIED,
VISIBILITY_PUBLISHED,
VISIBILITY_UNLISTED,
VISIBILITY_HIDDEN
overrides
object

A map of overrides for the banner. This is useful for scenarios where some subset of Banner instantiations should have different properties. The key is a content_id (either event ID, entity ID, or creative work ID), the value is the override to apply when that content is in context.

Note that a hit on a banner override will entirely replace the banner template and data; it will not merge with the base banner.

geo_applicability_exempt
object

Viewers from these countries will not have this video ad shown.

geo_applicability_apply
object

Viewers from these countries will have this video ad shown.

destination_url
object

Optional. A map of localized destination URLs. The key is the language code (ISO 639 - set 1), e.g. "en", "de", "fr", etc. If you want to localize the URL for different regions of the same language, you can add the country code (ISO 3166-1 alpha-2), e.g. "en-US", "en-GB", etc. Note that this is not necessary for banners of type BANNER_TYPE_EVENT, BANNER_TYPE_CREATIVE_WORK, or BANNER_TYPE_ENTITY, as the destination URL will be derived from the connected content item in those cases.

Response

OK

banner
object

Banner represents a single banner that can be displayed on an end-user facing web/app page. Banners can be either static (with fixed content) or dynamic (content derived from parameters).