File size: 2.46Kb
<div class="content__inner">
<h2>Vote polls</h2>
<p>
Please use this <strong>(<?php echo cl_link("mobile_api/vote_polls"); ?>) API endpoint for polls voting</strong>
</p>
<br>
<h4 class="table-title">Post parameters</h4>
<table class="table table-bordered">
<thead>
<tr>
<th width="15%">Field</th>
<th width="25%">Value</th>
<th width="45%">Remarks</th>
</tr>
</thead>
<tbody>
<tr>
<td>session_id</td>
<td>Access token ID</td>
<td>
E.g. de25cc16eb00960f076...
</td>
</tr>
<tr>
<td>post_id</td>
<td>Post int ID</td>
<td>
E.g. 84
</td>
</tr>
<tr>
<td>poll_id</td>
<td>Poll index ID (starts from 0,1,2,3 etc..)</td>
<td>
E.g. To vote frist option of a poll send <b>0</b>
</td>
</tr>
</tbody>
</table>
<h4 class="table-title">Success response</h4>
<div class="code-holder">
<div class="code-holder-inner">
<pre><code class="json">{
"code": 200,
"message": "Poll voted successfully",
"data":{
"poll_data":{
"has_voted": 1,
"total": 1,
"options":[
{
"percentage": "0",
"total": 0,
"option": "option 1"
},
{
"percentage": "100",
"total": 1,
"option": "option 2"
},
{
"percentage": "0",
"total": 0,
"option": "option 2"
}
]
}
}
}
</code></pre>
</div>
</div>
<h4 class="table-title">Error responses</h4>
<div class="code-holder">
<div class="code-holder-inner">
<pre><code class="json">{
"code": 400,
"message": "An error occurred while processing your request",
"data": []
}
{
"code": 400,
"message": "Post id is missing or invalid",
"data": []
}
</code></pre>
</div>
</div>
</div>