List

To list the existing polls for a room you need to execute a GET request against the /rooms/:roomId/polls endpoint.

Since potentially there could be a lot of polls, pagination is supported with limit, order and after arguments. Read about pagination to learn the details of it. By default maximum 100 polls will be returned in the response.

If you want to retrieve the details of one concrete poll execute a GET request against the /rooms/:roomId/polls/:id endpoint

Request (listing all polls)

curl --request GET \
  --url https://api.digitalsamba.com/api/v1/rooms/c39d7c40-7ff7-4faa-b06f-698a639a9523/polls \
  --user YOUR_TEAM_ID:YOUR_DEVELOPER_KEY

Response (200 OK)

{
  "total_count": 200,
  "data": [
    {
      "id": "c15102d9-ed47-468c-8e5a-86be0c97c296",
      "question": "How many languages have you learned?",
      "anonymous": true,
      "multiple": true,
      "status": "created",
      "created_at": "2024-06-27T12:33:21Z"
    },
    {
      "id": "e221af19-6458-438d-820e-afc7c6077112",
      "question": "How old are you?",
      "anonymous": true,
      "multiple": false,
      "status": "ended",
      "created_at": "2024-06-21T14:25:41Z"
    }
    ...............98 more rooms...............
  ]
} 

The total_count is the total amount of polls you have for the room. It is NOT the amount of polls in the current page returned in the data array. In the above example you have 200 polls in total, but in the data array there will be maximum 100 polls (the default limit argument value).

Request (get a concrete poll)

curl --request GET \
  --url https://api.digitalsamba.com/api/v1/rooms/c39d7c40-7ff7-4faa-b06f-698a639a9523/polls/c15102d9-ed47-468c-8e5a-86be0c97c296 \
  --user YOUR_TEAM_ID:YOUR_DEVELOPER_KEY

Response (200 OK)

{
  "id": "c15102d9-ed47-468c-8e5a-86be0c97c296",
  "question": "How many languages have you learned?",
  "anonymous": true,
  "multiple": true,
  "status": "created",
  "options": [
    {
      "id": "ee0300ba-be73-4e8a-954a-3a0c2218913e",
      "text": "One"
    },
    {
      "id": "34914c0c-2bb6-4e58-9d0c-e393c4b61f5f",
      "text": "Two"
    },
    {
      "id": "93d07105-704d-4ced-a924-b266260012ce",
      "text": "Three"
    },
    {
      "id": "bf4029ac-461d-4488-ae5e-c6ba03be8ee5",
      "text": "More than three"
    }
  ],
  "created_at": "2024-06-27T12:33:21Z"
}

Last updated