Overview

circle-info

Monterosa / Interaction Cloudβ„’ was previously known as LViS. As such, you will find API documentation using the term.

Note that this documentation refers to Control API v2 and Control API v1 is no longer supported.

Control API is a server-side REST API which provides programmatic interface to the platform content management functions. Using this API a server-side script can interact with the the platform in order to manage content. For example, one can write a script which monitors content creation in an external CMS and automatically re-publishes articles via the platform.

Here is an example of Control API request which returns a list of events:

curl --request GET \
  --globoff --url 'https://environment.monterosa.cloud/api/v2/projects/a7fde717-6100-4377-8530-fbad083eb768/events?filter[only_listings]=true&filter[state]=future' \
  --header 'Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb' \
  --header 'Content-Type: application/vnd.api+json'

This responds with:

{
  "data": [
    {
      "id": "97a3bc87-3cc1-4ad9-842d-d67035badcc0",
      "type": "events",
      "attributes": {
        "name": "Event name",
        "duration": 3600,
        "original_duration": 3600,
        "start_mode": "manual",
        "repeat": false,
        "repeat_in": null,
        "feed_uuid": "95212462-fbf9-4acf-ab45-1078433fe75b",
        "live_stats_uuid": null,
        "extra_time": 60,
        "start_at": 1493218159,
        "start_at_iso": "2017-04-26T14:49:19Z",
        "end_at": 1493221759,
        "end_at_iso": "2017-04-26T15:49:19Z",
        "settings": [
          {
            "key": "tab_active",
            "values": {
              "all": null
            }
          },
...

Data format

Control API adheres to JSONAPI specificationarrow-up-right.

Authentication

Authentication is done via a bearer token. Each request must include a header with a valid token like in the example below. Technical details about authentication can be found in The OAuth 2.0 Bearer token usagearrow-up-right specification.

Request header example

Generating your API token

To generate an API token, login to Monterosa / Interaction Cloudβ„’.

Hover your mouse over your username in the top right corner. From the dropdown menu choose Account Settings.

In the API Credentials tab you will see options to generate and revoke your token.

Access level

Every token has the same permissions as the user who generated this token, i.e. if the user has access to 3 Projects then the token will have access only to the same 3 Projects. In order to obtain a token with different permissions from your user, for example a token for read-only access, then a new user with desired access level needs to be created and then a token for this user can be generated.

Rate limit

A rate limit is applied to every API request. It is scoped to the authentication token, which means that every API client has an independent request count calculation.

The platform allocates a bucket of 15 requests for each authentication token. These requests can all be made within the same second or spread over time. Every second when there is no request made, 2 requests are added to the bucket, up to a maximum of 15.

circle-exclamation

Response

If the rate limit level is exceeded, HTTP code 429 Too Many Requests is returned. This response should be handled by implementing API requests throttling and backoff strategies.

Error response

Resource limits

Events creation limit

Default value: 7. Can be increased by request.

When this number of current and future scheduled Events is created within the project the Control API cannot be used to create new Events. Note that Events can still be created manually via Studio.

Error response

Elements creation limit

Default value: 100. Can be increased by request.

When this number of elements is created within an event the Control API cannot be used to create more elements within the event. Note that elements can still be created manually via Studio.

Error response

Capabilities

Below is the list of functions supported by the Control API:

Project

View

βœ”

Create, Update and Delete

βœ”

Event

View

βœ”

Update

βœ”

Create

βœ”

Start

βœ”

Stop

βœ”

Delete

✘

Create from a template

✘

Clone

✘

Element

View

βœ”

Create

βœ”

Update

βœ”

Stop

βœ”

Reveal results

βœ”

Publish

βœ”

Revoke

βœ”

Reveal answer

βœ”

Delete

✘

Pagination

The Control API supports pagination for GET events requests.

The response body for such request contains links object with next and previous pages URLs.

The response without the next or prev means that the last page in corresponding direction is reached.

To get the first page the request URL must omit page[cursor] parameter.

To change the maximum records count on page use page[count] parameter. Values between 1 and 20 are allowed. Default value is 20.

File and image URLs validation

The Control API validates the format of provided URLs and returns a validation error for invalid URLs.

Example of valid urls:

  • https://bucket.io/image.png

  • http://images.com/images/123

  • //d3mss.cloudfront.net/assets/1c/logo.jpeg

The Control API allows URLs with leading and trailing whitespace. Whitespace is ignored during validation and removed before saving.

Validation of images

The Control API supports pixel size, aspect ratio and file size validation of images.

Parameters and limits for validation must be defined in the app spec.

During the validation, Studio fetches the image's properties by the provided image URL and validates them according to the app spec.

In the cases where Studio is not able to fetch an image's properties by the provided URL, the API returns the following error:

Error response

All possible errors in cases when an uploaded image does not meet the app spec:

Error response