POST restapi/personal/pages/{elementId}/contentblocks/polls/{contentBlockId}/votes/v1
Vote on a content block poll.
Request Information
URI Parameters
| Name | Description | Type | Additional information |
|---|---|---|---|
| elementId |
The unique identifier of the page element containing the poll |
integer |
Required |
| contentBlockId |
The unique identifier of the content block poll |
integer |
Required |
Body Parameters
The vote request containing the selected alternative
Itsolutions.Itslearning.Web.RestApi.Personal.Page.Requests.VoteRequest| Name | Description | Type | Additional information |
|---|---|---|---|
| VoteAlternativeId | integer |
None. |
Request Formats
application/json, text/json
Sample:
{
"voteAlternativeId": 1
}
application/xml, text/xml
Sample:
<VoteRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Itsolutions.Itslearning.Web.RestApi.Personal.Page.Requests"> <VoteAlternativeId>1</VoteAlternativeId> </VoteRequest>
application/x-www-form-urlencoded
Sample:
No sample available
Response Information
Resource Description
ContentBlockPoll with updated voting results
Itsolutions.Itslearning.Web.RestApi.Personal.Page.Responses.ContentBlockPoll| Name | Description | Type | Additional information |
|---|---|---|---|
| VotedAlternativeId |
Id of chosen alternative (null if not voted yet) |
integer |
None. |
| TotalVotes |
Total number of votes in the poll (null if not allowed to show) |
integer |
None. |
| Question |
Poll question |
string |
None. |
| Settings | Itsolutions.Itslearning.Web.RestApi.Personal.Page.Responses.ContentBlockPollSettings |
None. |
|
| Alternatives | Collection of Itsolutions.Itslearning.Web.RestApi.Personal.Page.Responses.ContentBlockPollAlternativeData |
None. |
|
| ContentBlockId |
Content block identifier |
integer |
None. |
| Type | Itsolutions.Itslearning.Web.RestApi.Personal.Page.Responses.ContentBlockType |
None. |
|
| Title |
Content block title |
string |
None. |
| Order |
Content block order in the page |
integer |
None. |
| LayoutZone |
Content block layout zone - left or right |
Itsolutions.Itslearning.Web.RestApi.Personal.Page.Responses.ContentBlockLayoutZone |
None. |
| Color |
Content block color |
Itsolutions.Itslearning.Web.RestApi.Personal.Page.Responses.ColorSchema |
None. |
Response Formats
application/json, text/json
Sample:
{
"votedAlternativeId": 1,
"totalVotes": 1,
"question": "sample string 1",
"settings": {
"showResults": "EditorsOnly",
"displayNumberOfVotes": true,
"userCanChangeVote": true
},
"alternatives": [
{
"alternativeId": 1,
"text": "sample string 2",
"resultPercentage": 1.1,
"votesCount": 1
},
{
"alternativeId": 1,
"text": "sample string 2",
"resultPercentage": 1.1,
"votesCount": 1
}
],
"contentBlockId": 2,
"type": "Text",
"title": "sample string 3",
"order": 4,
"layoutZone": "Left",
"color": "Default"
}
application/xml, text/xml
Sample:
<ContentBlockPoll xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Itsolutions.Itslearning.Web.RestApi.Personal.Page.Responses">
<Color>Default</Color>
<ContentBlockId>2</ContentBlockId>
<LayoutZone>Left</LayoutZone>
<Order>4</Order>
<Title>sample string 3</Title>
<Type>Text</Type>
<Alternatives>
<ContentBlockPollAlternativeData>
<AlternativeId>1</AlternativeId>
<ResultPercentage>1.1</ResultPercentage>
<Text>sample string 2</Text>
<VotesCount>1</VotesCount>
</ContentBlockPollAlternativeData>
<ContentBlockPollAlternativeData>
<AlternativeId>1</AlternativeId>
<ResultPercentage>1.1</ResultPercentage>
<Text>sample string 2</Text>
<VotesCount>1</VotesCount>
</ContentBlockPollAlternativeData>
</Alternatives>
<Question>sample string 1</Question>
<Settings>
<DisplayNumberOfVotes>true</DisplayNumberOfVotes>
<ShowResults>EditorsOnly</ShowResults>
<UserCanChangeVote>true</UserCanChangeVote>
</Settings>
<TotalVotes>1</TotalVotes>
<VotedAlternativeId>1</VotedAlternativeId>
</ContentBlockPoll>