Poll API v3 keeps working
Code written for the previous StrawPoll API keeps running. The v3 endpoints are served
unchanged at https://api.strawpoll.com/v3 (and https://strawpoll.com/api/v3), take the
same X-API-Key header and speak the same JSON, as described in the v3 OpenAPI spec.
New projects should use the Forms API (v4): it covers every question type, drafts, responses and invites. v3 will receive fixes, but no new features.
What a v3 poll is now
Every v3 poll is a form with one question:
v3 type | Form section |
|---|---|
multiple_choice with text options | multiple_choice |
multiple_choice with image options | picture_choice |
ranked_choice | ranked_choice |
meeting with date and time_range options | meeting |
The poll id is the form’s slug and option ids are choice ids, so you can mix both APIs:
create a poll through v3 and read its responses through v4, or the other way round. require_voter_names adds a contact section that asks for a name.
Forms with more than one question can be read through v3, which shows their first
question. Changing them through v3 is refused with 409 unsupported_form, so v3 never
removes questions it cannot see; use v4 for those.
Settings
poll_config | Form setting |
|---|---|
deadline_at | closesAt |
duplication_checking: ip, session, invite, none | responseDuplicateCheck: ip, session, code, none |
results_visibility: always, after_vote, after_deadline, never | resultsVisibility: public, public_after_response, public_after_close, private |
edit_vote_permissions: admin, admin_voter, voter, nobody | editResponsePermissions: admin, admin_own_responses, own_responses, nobody |
hide_participants | responsesVisibility: private |
allow_comments | allowComments, with public comments |
allow_vpn_users | the opposite of blockVPNUsers |
force_appearance: light, dark, auto | the light or dark StrawPoll theme, or none |
is_multiple_choice, multiple_choice_min, multiple_choice_max | the same, with 0 meaning no limit |
allow_other_option | write-in answers |
randomize_options | shuffled options |
allow_indeterminate | “if need be” answers in meeting polls |
require_voter_names | a name question; always on for meeting polls |
PUT/polls/{id} keeps every setting you leave out of poll_config, and keeps the votes of
options whose id you send back.
Forms set up in the editor can use checks v3 has no word for. They read as the closest
v3 value: a name check as session, an email check as invite.
Differences to know about
- Polls are published immediately. v3 had no drafts. Changes through
PUTgo live right away; a draft open in the editor is left alone. is_privateis alwaystrue. Polls are never listed publicly on the new platform.- Results.
poll_votesare1(chosen or yes),0(not chosen or no),2(if need be) andnull(not answered). Forranked_choicethey are the place the voter gave the option,1being first.poll_participantsis empty unless names are public or you own the poll. Results you are not allowed to see yet answer403 results_hidden. - Write-in answers appear as extra options with
is_write_in: true. - Comments are notes voters leave with their vote. You can list, read and (as the poll
owner) delete them;
POST/commentsandPUT/comments/{id}answer501. - Users. There are no public profiles:
/users/@me(or your own id) works, any other user is404.usernameisnullanduser_metaonly holds defaults.PATCH/users/@mechangesdisplayname. - Media.
POST/uploadtakes images (JPEG, PNG, GIF or WebP, up to 5 MB). Videos, YouTube and Giphy media are not supported, soPOST/mediaandPUT/media/{id}answer501.DELETE/media/{id}refuses images a poll still shows. - Counters that no longer exist, such as
view_countand points, are0. - Errors are JSON objects with
errorandcode, and the same rate limits apply as for v4.
Your existing keys
Keys from the previous platform keep working once your account has moved over. You can also create new keys in Settings → API keys; they work for v3 and v4.