{"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,"locales": [{"active": true,"default": false,"key": "de"},{"active": true,"default": true,"key": "en"}],"name": "Project","tracking_id": "UA-XXXXX-X"},"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"}}
// 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}],"settings": [{"key": "prompt_live_event","values": {"en": "Another Text","de": "Ein anderer Text"}},{"key": "language_selector_position","values": {"all": "left"}}]}}}
// 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,"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}}],"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}],"settings": [{"key": "prompt_live_event","values": {"en": "Another Text","de": "Ein anderer Text"}},{"key": "language_selector_position","values": {"all": "left"}}]}}}'
Here we create a project with name Project Name
as specified in /data/attributes/name
attribute.
The project has two locales with English as default.
In /data/attributes/settings
we set two fields. Field prompt_live_event
is localisable and you need to fill each locale as shown in the example. Field language_selector_position
is non-localisable, so the data for it goes into 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
.
// 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"}]}