Podio API Documentation

Voting: Batch update votings

PUT /voting/app/{app_id}/voting

Update app voting with new voting's provided in body.

Allows for CRUD operation in one batch.

  • Votings that has no "voting_id" will be created.
  • Existing votings that are not present in body will be removed..
  • Voting question is updated by one one provided in body
  • Order of voting's will be changed

Additionally in answer Voting:

  • Answers provided without ID will be created
  • Existing answers that are not present in body will be removed.
  • Answers with provided ID will have it's text updated.
  • Order of answers will be changed accordingly

 

This is to allow transactional modification of votings in application.

Parameters
app_id*
Required.
Request

Create two votings

      [             {                 'kind': 'fivestar',                 'question': 'fivestar voting question',             },             {                 'kind': 'answer',                 'question': 'answer voting question',                 'answers': [{'text': 'a'}, {'text': 'b'}, {'text': 'c'}],             }         ]  

Modify question

  [             {                 'answers': None,                 'question': 'fivestar voting question',                 'voting_id': self.fivestar_voting_id,                 'kind': 'fivestar',             },             {                 'answers': [{'answer_id': self.answer_a_id, 'text': 'a'},                             {'answer_id': self.answer_b_id, 'text': 'b'},                             {'answer_id': self.answer_c_id, 'text': 'c'}],                 'question': 'OTHER QUESTION',                 'voting_id': self.answer_voting_id,                 'kind': 'answer',             }         ]

Modify voting order

        [             {                 'answers': [{'answer_id': self.answer_a_id, 'text': 'a'},                             {'answer_id': self.answer_b_id, 'text': 'b'},                             {'answer_id': self.answer_c_id, 'text': 'c'}],                 'kind': 'answer',                 'question': 'TestVotingAPI text answer voting question',                 'voting_id': self.answer_voting_id             },             {                 'answers': None,                 'kind': 'fivestar',                 'question': 'TestVotingAPI fivestar voting question',                 'voting_id': self.fivestar_voting_id             }         ]  

 

Response [
{
"kind": "fivestar",
"question": "fivestar voting question",
"answers": null,
"voting_id": 57
},
{
"kind": "answer",
"question": "answer voting question",
"answers": [
{
"text": "a",
"answer_id": 81
},
{
"text": "b",
"answer_id": 82
},
{
"text": "c",
"answer_id": 83
}
],
"voting_id": 58
}
]

Sandbox

The sandbox only handles GET operations for now.