Get Element
Get element with specified id.
get
https://environment.lvis.io
/api/v2/elements/:element_id
Get Element
The response depends on the type of element, see examples below.
curl --request GET \
--url https://environment.lvis.io/api/v2/elements/2862e114-2fa9-47ae-8774-2ba0b27f1887 \
--header 'Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb' \
--header 'Content-Type: application/vnd.api+json'
Curl
Response
curl --request GET \
--url https://environment.lvis.io/api/v2/elements/2862e114-2fa9-47ae-8774-2ba0b27f1887 \
--header 'Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb' \
--header 'Content-Type: application/vnd.api+json'
{
"data": {
"id": "2862e114-2fa9-47ae-8774-2ba0b27f1887",
"type": "elements",
"attributes": {
"offset": 0,
"duration": 0,
"content_type": "media",
"start_mode": "manual",
"state": "non_scheduled",
"updated_at": null,
"updated_at_iso": null,
"revoked_at": null,
"revoked_at_iso": null,
"label": "Label example",
"name": "Name example",
"icon": "fal fa-question-circle",
"icon_colour": "#1F5DFF",
"duration_mode": "fixed",
"custom_fields": [
{
"key": "label",
"values": {
"en": "Label example",
"by": null
}
},
{
"key": "image",
"values": {
"all": "https://example.com/image.jpg"
}
}
]
},
"relationships": {
"event": {
"data": {
"id": "cafc2ae8-2cd6-4664-bb20-e9e30a5f0e8d",
"type": "events"
}
},
"stats": {
"data": {
"id": "2862e114-2fa9-47ae-8774-2ba0b27f1887",
"type": "stats"
}
}
},
"links": {
"self": "https://environment.lvis.io/api/v2/elements/2862e114-2fa9-47ae-8774-2ba0b27f1887"
}
}
}
Curl
Response
curl --request GET \
--url https://environment.lvis.io/api/v2/elements/918bb262-ab85-48b0-bcb4-26ca7831d283?include=stats \
--header 'Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb' \
--header 'Content-Type: application/vnd.api+json'
{
"data": {
"id": "918bb262-ab85-48b0-bcb4-26ca7831d283",
"type": "elements",
"attributes": {
"offset": 56,
"content_type": "prediction",
"start_mode": "manual",
"state": "current",
"updated_at": 1666628736,
"updated_at_iso": "2022-10-24T16:25:36Z",
"revoked_at": null,
"revoked_at_iso": null,
"duration": 3544,
"custom_fields": [
{
"key": "text_during_quiz",
"values": {
"en": "Make your decision now..."
}
},
{
"key": "text_after_answering",
"values": {
"en": "Thanks for answering"
}
},
{
"key": "text_after_quiz",
"values": {
"en": "Question is closed"
}
},
{
"key": "text_after_reveal",
"values": {
"en": "Question is revealed"
}
}
],
"label": "Sample question",
"question": {
"label": "Sample question",
"fields": [
{
"key": "text",
"values": {
"en": "Sample question"
}
},
{
"key": "image_url",
"values": {
"en": null
}
}
],
"filter_keywords": [],
"options": [
{
"label": "Option 1",
"fields": [
{
"key": "text",
"values": {
"en": "Option 1"
}
},
{
"key": "image_url",
"values": {
"en": null
}
}
],
"filter_keywords": []
},
{
"label": "Option 2",
"fields": [
{
"key": "text",
"values": {
"en": "Option 2"
}
},
{
"key": "image_url",
"values": {
"en": null
}
}
],
"filter_keywords": []
}
]
},
"reveal_results_mode": "always",
"require_verified_user": false,
"include_in_latest_results_feed": true,
"certification": false,
"enmasse_id": 123734,
"correct_option": null,
"max_votes_per_user": 1,
"max_votes_per_option": 1
},
"relationships": {
"stats": {
"data": {
"id": "918bb262-ab85-48b0-bcb4-26ca7831d283",
"type": "stats"
}
},
"event": {
"data": {
"id": "377e15f6-c0f3-42e3-855e-d79ba7a3bab9",
"type": "events"
}
}
},
"links": {
"self": "https://environment.lvis.io/api/v2/elements/918bb262-ab85-48b0-bcb4-26ca7831d283"
}
},
"included": [
{
"id": "918bb262-ab85-48b0-bcb4-26ca7831d283",
"type": "stats",
"attributes": {
"aggregated": {
"voters": 1,
"votes": 1,
"results": [
{
"votes": 86380,
"percentage": 70
},
{
"votes": 37020,
"percentage": 30
}
]
},
"sources": [
{
"source": "regular",
"voters": 1,
"votes": 1,
"results": [
{
"votes": 86380,
"percentage": 70
},
{
"votes": 37020,
"percentage": 30
}
]
}
],
"results_are_final": false
}
}
]
}
Last modified 5mo ago