Drupal 8 Poll + REST
- Enable poll, rest, restui and poll_rest modules.
- Head over to
/admin/config/services/rest
and enable the poll vote resource. - Enable the POST method.
- Save.
Make a post request to /api/v1/poll/1/vote?_format=json
, where 1
the the poll id, with the following payload:
{
"chid": 2
}
chid
is the choice id.