Create Project

Create project within specified application.

Create Project

POST https://environment.monterosa.cloud/api/v2/projects

Headers

NameTypeDescription

Authorization

string

Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb

Content-Type

string

application/vnd.api+json

Request Body

NameTypeDescription

presence_counter[min_threshold]

integer

Minimal threshold. Can be greater than or equal to 0. Default value can be set via App Spec.

presence_counter[enabled]

boolean

Switch on/off presence counter.

presence_counter

object

Presence counter on client application setup. Available if it is enabled on App Spec level only.

name

string

Project's name.

hidden_elements

array

Project's elements visibility settings.

audio_sync_default_delay

integer

Project's audio sync default delay.

audio_sync_max_delay

integer

Project's audio sync max delay.

certification_enabled

boolean

Defines if Certification is enabled for a project.

locales

array

List of project locales.

settings

array

List of fields of project settings. Each field is updated separately and if present its content is rewritten completely.

archived

boolean

Marks project as archtived. Default false.

environment

string

Sets environment of the project. Allowed values: "staging" (default), "production".

{
  "data": {
    "id": "a8e22ad3-b8b1-4fe2-a08a-45e5ba39df7d",
    "attributes": {
      "assets": {},
      "audio_sync_default_delay": 2,
      "audio_sync_max_delay": 5,
      "certification_enabled": true,
      "embed": "//apps.lvis.tv/elements/20.2.1/app.html?p=a8e22ad3-b8b1-4fe2-a08a-45e5ba39df7d&h=d3vtzxnppyvur.cloudfront.net",
      "history_ignore": 45,
      "hidden_elements": [
        {
          "type": "vote",
          "hidden": true
        },
        {
          "type": "emote",
          "hidden": true
        }
      ],
      "locales": [
        {
          "active": true,
          "default": false,
          "key": "de"
        },
        {
          "active": true,
          "default": true,
          "key": "en"
        }
      ],
      "name": "Project",
      "tracking_id": "UA-XXXXX-X",
      "archived": false,
      "environment": "staging"
    },
    "links": {
      "self": "http://example.lvis.io/api/v2/projects/a8e22ad3-b8b1-4fe2-a08a-45e5ba39df7d"
    },
    "relationships": {
      "events": {
        "links": {
          "related": "http://example.lvis.io/api/v2/projects/a8e22ad3-b8b1-4fe2-a08a-45e5ba39df7d/events"
        }
      },
      "app": {
        "data": {
          "id": "0464bec1-2b27-4899-9909-36dd083dd2b4",
          "type": "apps"
        }
      },
      "brand": {
        "data": {
          "id": "b40b57d9-e34d-4794-bcf4-e910b9d283d4",
          "type": "brands"
        }
      }
    },
    "type": "projects"
  }
}

Example

// POST /api/v2/projects
// Host: environment.monterosa.cloud
// Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb
// Content-Type: application/vnd.api+json

{
  "data": {
    "type": "projects",
    "relationships": {
      "app": {
        "data": {
          "type": "apps",
          "id": "a26b52f0-8ad7-423b-91b9-7ea18702c939"
        }
      }
    },
    "attributes": {
      "name": "Project Name",
      "locales": [
        {
          "key": "en",
          "default": true,
          "active": true
        },
        {
          "key": "de",
          "default": false,
          "active": true
        }
      ],
      "hidden_elements": [
        {
          "type": "vote",
          "hidden": true
        },
        {
          "type": "emote",
          "hidden": true
        }
      ],
      "settings": [
        {
          "key": "prompt_live_event",
          "values": {
            "en": "Another Text",
            "de": "Ein anderer Text"
          }
        },
        {
          "key": "language_selector_position",
          "values": {
            "all": "left"
          }
        }
      ],
      "presence_counter": {
        "enabled": true,
        "supported": true,
        "min_threshold": 10000
      }
    }
  }
}

In example above project is created with name "Project Name" as specified in /data/attributes/name attribute.

Project is created with two locales. English locale is set as default.

Project settings /data/attributes/settings contains two fields:

  • prompt_live_event is localisable and has values for each locale.

  • language_selector_position is non-localisable, value provided by all key.

Available fields for /data/attributes/settings defined in project settings spec.

The project is created within the app with id a26b52f0-8ad7-423b-91b9-7ea18702c939 as set by /data/relationships/app/data/id.

Attribute /data/attributes/hidden_elements specifies that "vote" and "emote" are hidden on UI. It is similar to uncheck "vote" and "emote" on "Elements" tab on project settings page.

Validation error messages about invalid attributes

// POST /api/v2/projects
// Host: environment.monterosa.cloud
// Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb
// Content-Type: application/vnd.api+json

{
  "data": {
    "type": "projects",
    "attributes": {
      "name": "Project Name"
    }
  }
}