Create Project
Create project within specified application.
post
https://environment.lvis.io
/api/v2/projects
Create Project
Request
Response
cURL
// POST /api/v2/projects
// Host: environment.lvis.io
// 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
}
}
}
}
// Status: 201 Created
{
"data": {
"id": "471eaa2c-6b3f-4678-8889-30b1806829c0",
"type": "projects",
"attributes": {
"name": "Project Name",
"locales": [
{
"active": true,
"default": true,
"key": "en"
},
{
"active": true,
"default": false,
"key": "de"
}
],
"certification_enabled": false,
"hidden_elements": [
{
"type": "vote",
"hidden": true
},
{
"type": "emote",
"hidden": true
}
],
"settings": [
{
"key": "logo",
"values": {
"en": null,
"de": null
}
},
{
"key": "language_selector_position",
"values": {
"all": "left"
}
},
{
"key": "show_last_element_on_load",
"values": {
"all": true
}
},
{
"key": "prompt_no_event",
"values": {
"en": "No event available",
"de": null
}
},
{
"key": "prompt_unstarted_event",
"values": {
"en": "This event hasn't started yet",
"de": null
}
},
{
"key": "prompt_live_event",
"values": {
"en": "Another Text",
"de": "Ein anderer Text"
}
},
{
"key": "prompt_finished_event",
"values": {
"en": "This event has now finished",
"de": null
}
}
],
"presence_counter": {
"enabled": true,
"min_threshold": 10000
},
"history_ignore": 45,
"audio_sync_default_delay": 0,
"audio_sync_max_delay": 0,
"embed": "//apps.lvis.io/elements/22.6.3/app.html?p=c3deeb7c-2d0c-4173-99f6-9dd82c098d3c&h=d1hox4kfomq6ql.cloudfront.net",
"tracking_id": "",
"assets": {}
},
"relationships": {
"events": {
"links": {
"related": "https://environment.lvis.io/api/v2/projects/471eaa2c-6b3f-4678-8889-30b1806829c0/events"
}
},
"app": {
"data": {
"id": "0464bec1-2b27-4899-9909-36dd083dd2b4",
"type": "apps"
}
},
"brand": {
"data": {
"id": "b40b57d9-e34d-4794-bcf4-e910b9d283d4",
"type": "brands"
}
}
},
"links": {
"self": "https://environment.lvis.io/api/v2/projects/471eaa2c-6b3f-4678-8889-30b1806829c0"
}
}
}
curl --request POST \
--url https://environment.lvis.io/api/v2/projects \
--header 'Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb' \
--header 'Content-Type: application/vnd.api+json' \
--data '{
"data": {
"type": "projects",
"relationships": {
"app": {
"data": {
"type": "apps",
"id": "a26b52f0-8ad7-423b-91b9-7ea18702c939"
}
},
"account": {
"data": {
"type": "accounts",
"id": "86e3ce6b-f637-4458-a34f-7ef9feb1d780"
}
}
},
"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"
}
}
]
}
}
}'
In example above project is created with name "Project Name" as specified in
/data/attributes/name
attribute.Project settings
/data/attributes/settings
contains two fields: 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.Request
Response
// POST /api/v2/projects
// Host: environment.lvis.io
// Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb
// Content-Type: application/vnd.api+json
{
"data": {
"type": "projects",
"attributes": {
"name": "Project Name"
}
}
}
// Status: 422 Unprocessable Entity
{
"errors": [
{
"source": {
"pointer": "/data/attributes/settings"
},
"detail": "is missing"
},
{
"source": {
"pointer": "/data/relationships"
},
"detail": "is missing"
}
]
}
Last modified 1yr ago