Create Event

Create event within specified project.

post
Create Event

https://environment.lvis.io/api/v2/events
Request
Response
Request
Headers
Authorization
required
string
Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb
Content-Type
required
string
application/vnd.api+json
Body Parameters
name
required
string
Event name.
duration
required
integer
Event duration.
start_at
required
integer
Planned event start time (timestamp).
start_mode
required
string
Start mode, one of : "manual", "clock".
repeat
optional
boolean
true to say this event has to be automatically recreated after it's finished.
repeat_in
optional
integer
Repeat event will be automatically created in repeat_in minutes after end of original event.
settings
optional
array
List of fields of event settings. Each field is updated separately and if present its content is rewritten completely.
action
optional
string
Set to perform action on event. Possible actions: start - start manual event.
Response
201: Created
{
"data": {
"id": "18b17c20-5e84-4086-8da0-784f21622e16",
"type": "events",
"attributes": {
"name": "Live Event",
"duration": 3600,
"start_at": 1458487800,
"start_at_iso": "2016-03-20T15:30:00Z",
"start_mode": "manual",
"repeat": false,
"settings": [
{
"key": "hold_prompt",
"values": {
"en": "We'll be back shortly",
"de": "Wir sind gleich wieder da"
}
}
],
"state": "future"
},
"links": {
"self": "https://example.lvis.io/api/v2/events/18b17c20-5e84-4086-8da0-784f21622e16"
},
"relationships": {
"elements": {
"links": {
"related": "https://example.lvis.io/api/v2/events/18b17c20-5e84-4086-8da0-784f21622e16/elements"
}
},
"pause_markers": {
"links": {
"related": "https://example.lvis.io/api/v2/events/18b17c20-5e84-4086-8da0-784f21622e16/pause_markers"
}
},
"stats": {
"data": {
"id": "18b17c20-5e84-4086-8da0-784f21622e16",
"type": "stats"
}
},
"project": {
"data": {
"id": "850e644e-f1ea-444d-bae3-cf38badbe501",
"type": "projects"
}
}
}
}
}

Example

Request
Response
cURL
Request
// POST /api/v2/events
// Host: environment.lvis.io
// Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb
// Content-Type: application/vnd.api+json
{
"data": {
"type": "events",
"relationships": {
"project": {
"data": {
"type": "projects",
"id": "850e644e-f1ea-444d-bae3-cf38badbe501"
}
}
},
"attributes": {
"name": "Live Event",
"duration": 3600,
"start_at": 1458487800,
"start_mode": "manual",
"repeat": false,
"settings": [
{
"key": "hold_prompt",
"values": {
"en": "We will be back shortly",
"de": "Wir sind gleich wieder da"
}
},
{
"key": "advert_code",
"values": {
"all" : "Advert code"
}
}
]
}
}
}
Response
// Status: 201 Created
{
"data": {
"id": "18b17c20-5e84-4086-8da0-784f21622e16",
"type": "events",
"attributes": {
"name": "Live Event",
"duration": 3600,
"start_at": 1458487800,
"start_at_iso": "2016-03-20T15:30:00Z",
"start_mode": "manual",
"repeat": false,
"settings": [
{
"key": "hold_prompt",
"values": {
"en": "We will be back shortly",
"de": "Wir sind gleich wieder da"
}
}
],
"state": "future"
},
"links": {
"self": "https://example.lvis.io/api/v2/events/18b17c20-5e84-4086-8da0-784f21622e16"
},
"relationships": {
"elements": {
"links": {
"related": "https://example.lvis.io/api/v2/events/18b17c20-5e84-4086-8da0-784f21622e16/elements"
}
},
"pause_markers": {
"links": {
"related": "https://example.lvis.io/api/v2/events/18b17c20-5e84-4086-8da0-784f21622e16/pause_markers"
}
},
"stats": {
"data": {
"id": "18b17c20-5e84-4086-8da0-784f21622e16",
"type": "stats"
}
},
"project": {
"data": {
"id": "850e644e-f1ea-444d-bae3-cf38badbe501",
"type": "projects"
}
}
}
}
}
cURL
curl --request POST \
--url https://environment.lvis.io/api/v2/events \
--header 'Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb' \
--header 'Content-Type: application/vnd.api+json' \
--data '{
"data": {
"type": "events",
"relationships": {
"project": {
"data": {
"type": "projects",
"id": "850e644e-f1ea-444d-bae3-cf38badbe501"
}
}
},
"attributes": {
"name": "Live Event",
"duration": 3600,
"start_at": 1458487800,
"start_mode": "manual",
"repeat": false,
"settings": [
{
"key": "hold_prompt",
"values": {
"en": "We will be back shortly",
"de": "Wir sind gleich wieder da"
}
},
{
"key": "advert_code",
"values": {
"all" : "Advert code"
}
}
]
}
}
}'

Create an event and start it

To start new event action must be set to start. Otherwise event will be started according to start_mode and start_at properties.

Request
Response
Request
// POST /api/v2/events
// Host: environment.lvis.io
// Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb
// Content-Type: application/vnd.api+json
{
"data": {
"type": "events",
"relationships": {
"project": {
"data": {
"type": "projects",
"id": "f1b50562-edae-43e9-8f4f-4f8e6765ef91"
}
}
},
"attributes": {
"name": "Event Name",
"start_mode": "manual",
"duration": 60,
"action": "start",
"start_at": 1458487800,
"settings": []
}
}
}
Response
// Status: 201 Created
{
"data": {
"id": "6926723a-dddb-4519-a631-1f616a90f78f",
"type": "events",
"attributes": {
"name": "Event Name",
"duration": 60,
"original_duration": 60,
"start_mode": "manual",
"repeat": false,
"repeat_in": null,
"feed_uuid": "af4c1b02-c6bc-47c6-a6b9-0e186721537b",
"live_stats_uuid": null,
"extra_time": 60,
"start_at": 1458487800,
"start_at_iso": "2016-03-20T15:30:00Z",
"end_at": 1458487860,
"end_at_iso": "2016-03-20T15:31:00Z",
"settings": [],
"state": "future",
"actions": []
},
"relationships": {
"elements": {
"links": {
"related": "https://environment.lvis.io/api/v2/events/6926723a-dddb-4519-a631-1f616a90f78f/elements"
}
},
"pause_markers": {
"links": {
"related": "https://environment.lvis.io/api/v2/events/6926723a-dddb-4519-a631-1f616a90f78f/pause_markers"
}
},
"stats": {
"data": {
"id": "6926723a-dddb-4519-a631-1f616a90f78f",
"type": "stats"
}
},
"project": {
"data": {
"id": "f1b50562-edae-43e9-8f4f-4f8e6765ef91",
"type": "projects"
}
}
},
"links": {
"self": "https://environemnt.lvis.io/api/v2/events/6926723a-dddb-4519-a631-1f616a90f78f"
}
}
}

Validation error message about an invalid attribute

Request
Response
Request
// POST /api/v2/events
// Host: environment.lvis.io
// Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb
// Content-Type: application/vnd.api+json
{
"data": {
"type": "events",
"relationships": {
"project": {
"data": {
"type": "projects",
"id": "4c7ec57b-b03f-4c6c-b52c-ced4b3ef23c1"
}
}
},
"attributes": {
"name": "Event Name",
"start_mode": "manual",
"duration": -1,
"start_at": 1458487800,
"settings": []
}
}
}
Response
// Status: 422 Unprocessable Entity
{
"errors": [
{
"source": {
"pointer": "/data/attributes/duration"
},
"detail": "must be greater than 0"
}
]
}