Create Event Template
Create event template within specified project.
Create Event Template
POST
https://environment.monterosa.cloud/api/v2/event_templates
Headers
Name | Type | Description |
---|---|---|
Authorization | string | Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb |
Content-Type | string | application/vnd.api+json |
Request Body
Name | Type | Description |
---|---|---|
name | string | Event template name. |
duration | integer | Event template duration. |
settings | array | List of fields of event template settings. Each field is updated separately and if present its content is rewritten completely. |
{
"data": {
"id": "b9cb1ba0-d1d3-4f44-8248-d78f8bd4a323",
"type": "event_templates",
"attributes": {
"duration": 600,
"name": "Event Template",
"settings": [
{
"key": "text",
"values": {
"all": "value"
}
}
]
},
"relationships": {
"elements": {
"links": {
"related": "https://environment.lvis.io/api/v2/event_templates/b9cb1ba0-d1d3-4f44-8248-d78f8bd4a323/elements"
}
},
"project": {
"data": {
"id": "2773ab5e-227a-4e66-8749-84da7d94c2d2",
"type": "projects"
}
}
},
"links": {
"self": "https://environment.lvis.io/api/v2/event_templates/b9cb1ba0-d1d3-4f44-8248-d78f8bd4a323"
}
}
}
Example
// POST /api/v2/event_templates
// Host: environment.monterosa.cloud
// Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb
// Content-Type: application/vnd.api+json
{
"data": {
"type": "event_templates",
"relationships": {
"project": {
"data": {
"type": "projects",
"id": "850e644e-f1ea-444d-bae3-cf38badbe501"
}
}
},
"attributes": {
"name": "Event Template",
"duration": 3600,
"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": "Event Template",
"duration": 3600,
"settings": [
{
"key": "hold_prompt",
"values": {
"en": "We will be back shortly",
"de": "Wir sind gleich wieder da"
}
}
],
},
"links": {
"self": "https://environment.monterosa.cloud/api/v2/event_templates/18b17c20-5e84-4086-8da0-784f21622e16"
},
"relationships": {
"elements": {
"links": {
"related": "https://environment.monterosa.cloud/api/v2/event_templates/18b17c20-5e84-4086-8da0-784f21622e16/elements"
}
},
"project": {
"data": {
"id": "850e644e-f1ea-444d-bae3-cf38badbe501",
"type": "projects"
}
}
}
}
}
curl --request POST \
--url https://example.monterosa.cloud/api/v2/event_templates \
--header 'Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb' \
--header 'Content-Type: application/vnd.api+json' \
--data '{
{
"data": {
"type": "event_templates",
"relationships": {
"project": {
"data": {
"type": "projects",
"id": "850e644e-f1ea-444d-bae3-cf38badbe501"
}
}
},
"attributes": {
"name": "Event Template",
"duration": 3600,
"settings": [
{
"key": "hold_prompt",
"values": {
"en": "We will be back shortly",
"de": "Wir sind gleich wieder da"
}
},
{
"key": "advert_code",
"values": {
"all" : "Advert code"
}
}
]
}
}
}
}'