Create a new call to action

Supported Formats

json

Errors

Code Description
400 Bad Request: body has wrong syntax or unable to handle request
401 Unauthorized: auth_token omitted or authentication failed
403 Forbidden: This action cannot be performed
404 Not Found: The requested resource could not be found
406 Not Acceptable: Accept or Content-Type headers must be application/json, text/csv or application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
422 Unprocessable Entity: body has wrong attributes

Examples

REQUEST
Content-Type: application/json
{
  "chapter_id": 1024,
  "second": 145,
  "duration": 16,
  "auto_close": true,
  "width": 300,
  "html": "<div class=\"main\">Checkout my CTA!</div>"
}

RESPONSE
201 (Created)
{
  "chapter_id": 1024,
  "second": 145,
  "duration": 16,
  "auto_close": true,
  "width": 300,
  "html": "<div class=\"main\">Checkout my CTA!</div>",
  "id": 8192,
  "created_at": 1374261385,
  "updated_at": 1374261385
}

Params

Param name Description
auth_token
optional

API token needed to authorize requests
This can appear as an attribute in the body of the request or the query parameters on the URL

Validations:

  • Must be a String

chapter_id
required

The chapter this call to action will be added to. Not passing this parameter will create a default event.

Validations:

  • Parameter has to be Integer.

second
required

The start time of this call to action in seconds. Use -1 for Postroll CTAs.

Validations:

  • Parameter has to be Integer.

duration
optional

The duration this call to action will be displayed
This is required when auto_close is true, otherwise it is not used

Validations:

  • Parameter has to be Integer.

auto_close
optional

The call to action will automatically close after the set duration
Duration is required when auto_close is true
Default: true

Validations:

  • Parameter has to be Boolean.

width
required

Width in pixels of the call to action popout
Width can be between 100 and 500 pixels inclusive

Validations:

  • Parameter has to be Integer.

html
required

HTML this call to action will display. May include JavaScript and HTML forms.

Validations:

  • Must be a String