Create poll
API to create a poll

Fields Information

Poll

Key
Type
Description
question required
string
The question/title of the Poll
identifier
string
Can be used to pass in custom identifier, eg - user id, email, etc.
data
object
A flexible data field to store any meta data with each option

Option

Minimum 2 Options are required in a poll (Just making the obvious known
😅
)
Key
Type
Description
text required
string
String to store the option's text
data
object
A flexible data field to store any meta data with each option
post
https://api.pollsapi.com/v1
/create/poll
Creating a Poll

Example cURL request

1
curl -X POST \
2
'https://api.pollsapi.com/v1/create/poll' \
3
-H 'content-type: application/json' \
4
-H "api-key: $API_KEY" \
5
-d '
6
{
7
"question": "Do you like polls?",
8
"options": [
9
{
10
"text": "Yes"
11
},
12
{
13
"text": "No"
14
}
15
]
16
}
17
'
Copied!

Request Body

1
{
2
"question": "Does this doc help?",
3
"identifier": "custom_identifier",
4
"data": {
5
"custom": "Poll Data"
6
}
7
"options": [
8
{
9
"text": "Option Text",
10
"data": {
11
"custom": "data"
12
}
13
},
14
{
15
"text": "Option Text2",
16
"data": {
17
"custom": "data"
18
}
19
}
20
]
21
}
Copied!

Last modified 11mo ago