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

Create a new poll content block.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
elementId

The unique identifier of the page element

integer

Required

Body Parameters

The poll content block creation request

Itsolutions.Itslearning.Web.RestApi.Personal.Page.Requests.CreateContentBlockPollsRequestUI
NameDescriptionTypeAdditional information
VotedAlternativeId

The identifier of the alternative that the current user has voted for. Null if the user has not voted yet.

integer

None.

TotalVotes

The total number of votes cast across all poll alternatives. Null if vote count is not available.

integer

None.

Question

The main question text displayed to users for the poll.

string

None.

Settings

The configuration settings that control poll behavior and display options.

Itsolutions.Itslearning.Web.RestApi.Personal.Page.Requests.PollSettings

None.

Alternatives

The collection of available voting options for the poll. Defaults to an empty list.

Collection of Itsolutions.Itslearning.Web.RestApi.Personal.Page.Requests.PollAlternative

None.

ContentBlockId

The unique identifier for the content block.

integer

None.

Type

The type of the content block (e.g. "text", "image", "files", "rss", "poll"). Defaults to an empty string.

string

None.

Title

The title of the content block. Defaults to an empty string.

string

None.

Order

The display order of the content block within its Layout Zone. Lower values appear first.

integer

None.

LayoutZone

The layout zone where the content block should be placed (e.g. "Left", "Right"). Determines the positioning within the page layout.

string

None.

Color

The color of the content block.

string

None.

Request Formats

application/json, text/json

Sample:
{
  "votedAlternativeId": 1,
  "totalVotes": 1,
  "question": "sample string 1",
  "settings": {
    "showResults": "sample string 1",
    "displayNumberOfVotes": true,
    "userCanChangeVote": true
  },
  "alternatives": [
    {
      "alternativeId": 1,
      "text": "sample string 2"
    },
    {
      "alternativeId": 1,
      "text": "sample string 2"
    }
  ],
  "contentBlockId": 2,
  "type": "sample string 3",
  "title": "sample string 4",
  "order": 5,
  "layoutZone": "sample string 6",
  "color": "sample string 7"
}

application/xml, text/xml

Sample:
<CreateContentBlockPollsRequestUI xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Itsolutions.Itslearning.Web.RestApi.Personal.Page.Requests">
  <Color>sample string 7</Color>
  <ContentBlockId>2</ContentBlockId>
  <LayoutZone>sample string 6</LayoutZone>
  <Order>5</Order>
  <Title>sample string 4</Title>
  <Type>sample string 3</Type>
  <Alternatives>
    <PollAlternative>
      <AlternativeId>1</AlternativeId>
      <Text>sample string 2</Text>
    </PollAlternative>
    <PollAlternative>
      <AlternativeId>1</AlternativeId>
      <Text>sample string 2</Text>
    </PollAlternative>
  </Alternatives>
  <Question>sample string 1</Question>
  <Settings>
    <DisplayNumberOfVotes>true</DisplayNumberOfVotes>
    <ShowResults>sample string 1</ShowResults>
    <UserCanChangeVote>true</UserCanChangeVote>
  </Settings>
  <TotalVotes>1</TotalVotes>
  <VotedAlternativeId>1</VotedAlternativeId>
</CreateContentBlockPollsRequestUI>

application/x-www-form-urlencoded

Sample:
No sample available

Response Information

Resource Description

Created poll content block

System.Web.Http.IHttpActionResult

None.

Response Formats

application/json, text/json, application/xml, text/xml

Sample:

Sample not available.