How to activate or deactivate through the url-based API

36 views
Skip to first unread message

Joost Broekens

unread,
Jan 14, 2017, 6:48:18 AM1/14/17
to Poll Everywhere Development & API Mailing List
Hi,

When I use:

curl -X PUT -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Basic MYAUTH" -d "{\"multiple_choice_poll\": {\"permalink\":\"Et84s3M4Q3V9aFJ\",\"state\":\"opened\",\"current\":\"true\"}}" "https://www.polleverywhere.com/multiple_choice_polls/Et84s3M4Q3V9aFJ"

(note: MYAUTH) is of course ok.

the poll status flag *current* never changes to true (nor to false for that matter).

When I do this through the webinterface it works.

Other changes (such as opened/closed) work fine, so there is no authentication or connection issue.

Is this disabled through the API?

Joost.

Michael Foley

unread,
Jan 15, 2017, 2:37:38 AM1/15/17
to Poll Everywhere Development & API Mailing List

Joost,


Activating/deactivating polls requires a separate URL. From our internal API documentation:


PUT /api/activation


Required params

  `type`

    String that represents the type of activity.

    Currently supported: "poll", "survey".

  `uid`

    Unique identifier String


Returns 400 if the `type` is invalid.

Returns 404 if you are not permitted to activate the Activity, or if the activity does not have an owner.

Returns 204 if activation was successful, even if it was a no-op.


For an example, I recommend using your browser's web inspector while manually activating a poll.


Mike

Poll Everywhere Engineering

Joost Broekens

unread,
Jan 23, 2017, 2:58:05 PM1/23/17
to Poll Everywhere Development & API Mailing List
Thannks a lot Mike.
It seems to work fine.

J.
Reply all
Reply to author
Forward
0 new messages