POST restapi/personal/pages/{elementId}/contentblocks/polls/{contentBlockId}/votes/v1

Request Information

URI Parameters

NameDescriptionTypeAdditional information
elementId

integer

Required

contentBlockId

integer

Required

Body Parameters

Itsolutions.Itslearning.Web.RestApi.Personal.Page.Requests.VoteRequest
NameDescriptionTypeAdditional 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

Itsolutions.Itslearning.Web.RestApi.Personal.Page.Responses.ContentBlockPoll
NameDescriptionTypeAdditional 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.

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,
  "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": 1,
  "type": "Text",
  "title": "sample string 2",
  "order": 3,
  "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>1</ContentBlockId>
  <LayoutZone>Left</LayoutZone>
  <Order>3</Order>
  <Title>sample string 2</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>
  <Settings>
    <DisplayNumberOfVotes>true</DisplayNumberOfVotes>
    <ShowResults>EditorsOnly</ShowResults>
    <UserCanChangeVote>true</UserCanChangeVote>
  </Settings>
  <TotalVotes>1</TotalVotes>
  <VotedAlternativeId>1</VotedAlternativeId>
</ContentBlockPoll>