Create Event
Create event within specified project.
Create event within specified project.
POST
https://environment.monterosa.cloud/api/v2/events
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
{
"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",
"end_mode": "duration",
"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"
}
},
"stats": {
"data": {
"id": "18b17c20-5e84-4086-8da0-784f21622e16",
"type": "stats"
}
},
"project": {
"data": {
"id": "850e644e-f1ea-444d-bae3-cf38badbe501",
"type": "projects"
}
}
}
}
}
// POST /api/v2/events
// Host: environment.monterosa.cloud
// 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",
"end_mode": "scheduled",
"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"
}
}
]
}
}
}
// 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",
"end_mode": "scheduled",
"repeat": false,
"settings": [
{
"key": "hold_prompt",
"values": {
"en": "We will be back shortly",
"de": "Wir sind gleich wieder da"
}
}
],
"state": "future"
},
"links": {
"self": "https://environment.monterosa.cloud/api/v2/events/18b17c20-5e84-4086-8da0-784f21622e16"
},
"relationships": {
"elements": {
"links": {
"related": "https://environment.monterosa.cloud/api/v2/events/18b17c20-5e84-4086-8da0-784f21622e16/elements"
}
},
"stats": {
"data": {
"id": "18b17c20-5e84-4086-8da0-784f21622e16",
"type": "stats"
}
},
"project": {
"data": {
"id": "850e644e-f1ea-444d-bae3-cf38badbe501",
"type": "projects"
}
}
}
}
}
curl --request POST \
--url https://environment.monterosa.cloud/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",
"end_mode": "scheduled",
"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"
}
}
]
}
}
}'
To start new event action
must be set to start
. Otherwise event will be started according to start_mode
and start_at
properties.
// POST /api/v2/events
// Host: environment.monterosa.cloud
// 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": []
}
}
}
// 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.monterosa.cloud/api/v2/events/6926723a-dddb-4519-a631-1f616a90f78f/elements"
}
},
"stats": {
"data": {
"id": "6926723a-dddb-4519-a631-1f616a90f78f",
"type": "stats"
}
},
"project": {
"data": {
"id": "f1b50562-edae-43e9-8f4f-4f8e6765ef91",
"type": "projects"
}
}
},
"links": {
"self": "https://environemnt.monterosa.cloud/api/v2/events/6926723a-dddb-4519-a631-1f616a90f78f"
}
}
}
// POST /api/v2/events
// Host: environment.monterosa.cloud
// 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": []
}
}
}
// Status: 422 Unprocessable Entity
{
"errors": [
{
"source": {
"pointer": "/data/attributes/duration"
},
"detail": "must be greater than 0"
}
]
}