Get Elements

Get all elements of the specified event.

Elements are returned in chronological order according their publishing time.

Get Elements

GET https://environment.monterosa.cloud/api/v2/events/:event_id/elements

Path Parameters

Name
Type
Description

event_id

string

Event ID.

Query Parameters

Name
Type
Description

filter[state]

string

Filter elements by element timeline state. Possible values: non_scheduled, future, cancelled, current, on_demand, past, revoked. In order to filter elements by multiple states, provide them separated by commas.

filter[include_in_latest_results]

boolean

Filter elements in order to display only those that are included in latest results. Possible values: true, false.

include

string

Include additional relation to the response. For example, include=stats adds element stats to the response. Possible values: stats.

Headers

Name
Type
Description

Authorization

string

Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb

Content-Type

string

application/vnd.api+json

{
  "data": [
    {
      "id": "24d98d49-8d7e-44f1-8ece-b75a5bcc2cdb",
      "type": "elements",
      "attributes": {
        "offset": 9,
        "certification": false,
        "duration": 651,
        "include_in_latest_results_feed": true,
        "max_votes_per_user": 1,
        "max_votes_per_option": 1,
        "content_type": "prediction-custom",
        "label": "Which came first, the chicken or the egg?",
        "require_verified_user": false,
        "reveal_results_mode": "never",
        "revoked_at": null,
        "revoked_at_iso": null,
        "start_mode": "manual",
        "state": "past",
        "enmasse_id": 4132,
        "correct_option": null,
        "updated_at": 1574340219,
        "updated_at_iso": "2019-11-21T12:43:39Z",
        "duration_mode": "fixed",
        "name": "Element",
        "results_revealed_at_iso": null,
        "answer_revealed_at_iso": null,
        "custom_fields": [
          {
            "key": "text_during_quiz",
            "values": {
              "ab": null,
              "en": "Make your decision now..."
            }
          },
          {
            "key": "text_after_answering",
            "values": {
              "all": "Thanks for answering"
            }
          },
          {
            "key": "text_after_quiz",
            "values": {
              "all": "Question is closed"
            }
          },
          {
            "key": "text_after_reveal",
            "values": {
              "all": "Question is revealed"
            }
          }
        ],
        "question": {
          "label": "Which came first, the chicken or the egg?",
          "filter_keywords": [],
          "fields": [
            {
              "key": "text",
              "values": {
                "ab": null,
                "en": "Which came first, the chicken or the egg?"
              }
            },
            {
              "key": "image_url",
              "values": {
                "ab": null,
                "en": null
              }
            }
          ],
          "options": [
            {
              "label": "The chicken"
              "filter_keywords": [],
              "fields": [
                {
                  "key": "text",
                  "values": {
                    "ab": null,
                    "en": "The chicken"
                  }
                },
                {
                  "key": "image_url",
                  "values": {
                    "ab": null,
                    "en": null
                  }
                }
              ]
            },
            {
              "label": "The egg",
              "filter_keywords": [],
              "fields": [
                {
                  "key": "text",
                  "values": {
                    "ab": null,
                    "en": "The egg"
                  }
                },
                {
                  "key": "image_url",
                  "values": {
                    "ab": null,
                    "en": null
                  }
                }
              ]
            }
          ]
        }
      },
      "links": {
        "self": "https://environment.monterosa.cloud/api/v2/elements/24d98d49-8d7e-44f1-8ece-b75a5bcc2cdb"
      },
      "relationships": {
        "event": {
          "data": {
            "id": "cafc2ae8-2cd6-4664-bb20-e9e30a5f0e8d",
            "type": "events"
          }
        },
        "stats": {
          "data": {
            "id": "24d98d49-8d7e-44f1-8ece-b75a5bcc2cdb",
            "type": "stats"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "24d98d49-8d7e-44f1-8ece-b75a5bcc2cdb",
      "type": "stats",
      "attributes": {
        "aggregated": {
          "results": [
            {
              "percentage": 0,
              "votes": 0
            },
            {
              "percentage": 100,
              "votes": 1
            }
          ],
          "voters": 1,
          "votes": 1
        },
        "results_are_final": false,
        "sources": [
          {
            "results": [
              {
                "percentage": 0,
                "votes": 0
              },
              {
                "percentage": 100,
                "votes": 1
              }
            ],
            "source": "regular",
            "voters": 1,
            "votes": 1
          }
        ]
      }
    }
  ],
  "links": {
    "self": "https://environment.monterosa.cloud/api/v2/events/4c60ee2c-869d-4632-af3f-546bb1c1e535/elements"
  }  
}

Example

Filter elements by non_scheduled state.

curl --request GET \
  --globoff --url 'https://environment.monterosa.cloud/api/v2/events/6977197a-51b1-4579-8785-dcd0e266d6dd/elements?filter[state]=non_scheduled' \
  --header 'Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb' \
  --header 'Content-Type: application/vnd.api+json'

Element attributes described in the Element Resource section.