pollService

Provides the ability to manage polls, which each typically appear in the end user UI as a multiple-choice question. A person can create a poll to ask others in the community for quick feedback.

People can create polls in any container, including spaces, projects, and social groups.

Method Description
addAnonymousVote Add a guest vote for an option in the poll.
addOption Add a new option to the poll.
addUserVote Add a user vote for an option in the poll.
changeAnonymousVote Change a guest vote.
changeUserVote Change a user vote.
createPoll Creates a new poll.
deleteOption Remove an option from the poll.
deletePoll Deletes the specified poll.
getActivePollCount Returns a count of all active polls in the system.
getActivePollCountByObjectTypeAndObjectID Returns a count of all active polls of a given type and object ID.
getActivePolls Returns an iterable of active polls in the system.
getActivePollsByObjectTypeAndObjectID Returns a list of active polls associated with the object specified by the objectType and objectID.
getAnonymousVoteCount Returns a count of all guests user votes for all options in the poll.
getAnonymousVoteCountByIndex Returns a count of all user votes for the specified option in the poll.
getAnonymousVoteIndices Returns a list of option indexes corresponding to the anonymous votes, or an empty array if the user has not voted.
getAnonymousVotes Returns a list of uniqueID's for guests who have voted for the option at the given index.
getAnonymousVotesByIndex Returns an Iterator of uniqueID's for guests who have voted for the option at the given index.
getLivePollCount Returns a count of all live polls in the system.
getLivePollCountByObjectTypeAndObjectID Returns a count of all live polls of a given type and object ID.
getLivePolls Returns a List of live polls in the system.
getLivePollsByObjectTypeAndObjectID Returns an iterable of live polls associated with the object specified by the objectType and objectID.
getPoll Returns the specified poll.
getPollCount Returns a count of all polls, both active and inactive.
getPollCountByObjectTypeAndObjectID Returns a count of polls, both active and inactive, associated with the object specified by the objectType and objectID.
getPolls Returns a list of all polls, both active and inactive.
getPollsByObjectTypeAndObjectID Returns a list of polls, both active and inactive, associated with the object specified by the objectType and objectID.
getUserVoteCount Returns a count of all user votes for all options in the poll.
getUserVoteCountByIndex Returns a count of all user votes for the specified option in the poll.
getUserVoteIndices Returns a list of option indexes corresponding to the user votes, or an empty array if the user has not voted.
getUserVotes Returns a List of User objects for users who have voted for any options in the poll.
getUserVotesByIndex Returns a list of User objects for users who have voted for the option at the given index.
getVoteCount Returns a count of all votes (both guest and user votes) for all options in the poll.
getVoteCountByIndex Returns a count of all votes (both guest and user votes) for the specified option in the poll.
hasAnonymousVoted Returns true if the guest associated with the uniqueID has previously voted in the poll, false otherwise.
hasUserVoted Returns true if the user specified has previously voted in the poll, false otherwise.
isModeEnabled Returns true if the mode specified is enabled for the poll, false otherwise.
removeAnonymousVote Remove a guest vote.
removeUserVote Remove a user vote.
setMode Sets a mode to be enabled or disabled for the poll.
setOption Sets the text of the option at the specified index.
setOptionIndex Moves the option's index.
update Update the poll.

addAnonymousVote

Add a guest vote for an option in the poll.

POST http://domain:port/application_context/rpc/rest/pollService/votes/anonymous

Arguments

Name Type Description
pollID xs:long the index of the option that the guest is voting for
index xs:int a uniqueID for the guest. We suggest either using a session ID or the remote IP of the guest voting.
uniqueID xs:string

Arguments Template

<addAnonymousVote> 
    <pollID>xs:long</pollID>
    <index>xs:int</index>
    <uniqueID>xs:string</uniqueID>
</addAnonymousVote>

Errors

Error When Returned
com.jivesoftware.community.PollException if the guest has previously voted in the poll (2 second leeway is provided for posting multiple votes if that mode is enabled) or the poll is not active.
Unauthorized if the guest does not have permission to vote.
NotFound

addOption

Add a new option to the poll. The option will be added to the end of the option list for the poll.

POST http://domain:port/application_context/rpc/rest/pollService/options

Arguments

Name Type Description
pollID xs:long the text for the new option.
value xs:string

Arguments Template

<addOption> 
    <pollID>xs:long</pollID>
    <value>xs:string</value>
</addOption>

Errors

Error When Returned
Unauthorized if the user does not have permissions to administer the poll.
NotFound

addUserVote

Add a user vote for an option in the poll.

POST http://domain:port/application_context/rpc/rest/pollService/votes/user

Arguments

Name Type Description
pollID xs:long the index of the option that the user is voting for
index xs:int the user making the vote
userID xs:long

Arguments Template

<addUserVote> 
    <pollID>xs:long</pollID>
    <index>xs:int</index>
    <userID>xs:long</userID>
</addUserVote>

Errors

Error When Returned
com.jivesoftware.community.PollException if the user has previously voted in the poll (2 second leeway is provided for posting multiple votes if that mode is enabled) or the poll is not active.
Unauthorized if the user does not have permission to vote.
NotFound

changeAnonymousVote

Change a guest vote. This method will throw a PollException unless the mode 'ALLOW_ANONYMOUS_VOTE_MODIFICATION' is enabled for the poll.

PUT http://domain:port/application_context/rpc/rest/pollService/votes/anonymous

Arguments

Name Type Description
pollID xs:long the index of the option to change the vote from.
prevOptionIndex xs:int the index of the option to change the vote to.
newOptionIndex xs:int a uniqueID for the guest.
uniqueID xs:string

Arguments Template

<changeAnonymousVote> 
    <pollID>xs:long</pollID>
    <prevOptionIndex>xs:int</prevOptionIndex>
    <newOptionIndex>xs:int</newOptionIndex>
    <uniqueID>xs:string</uniqueID>
</changeAnonymousVote>

Errors

Error When Returned
com.jivesoftware.community.PollException if the poll is not active, the guest did not vote for the prevOptionIndex or vote modification is not enabled for guests.
Unauthorized if the guest does not have permission to vote.
NotFound

changeUserVote

Change a user vote. This method will throw a PollException unless the mode 'ALLOW_USER_VOTE_MODIFICATION' is enabled for the poll.

PUT http://domain:port/application_context/rpc/rest/pollService/votes/user

Arguments

Name Type Description
pollID xs:long the index of the option to change the vote from.
prevOptionIndex xs:int the index of the option to change the vote to.
newOptionIndex xs:int
userID xs:long

Arguments Template

<changeUserVote> 
    <pollID>xs:long</pollID>
    <prevOptionIndex>xs:int</prevOptionIndex>
    <newOptionIndex>xs:int</newOptionIndex>
    <userID>xs:long</userID>
</changeUserVote>

Errors

Error When Returned
com.jivesoftware.community.PollException if the poll is not active, the user did not vote for the prevOptionIndex or vote modification is not enabled for users.
Unauthorized if the user does not have permission to vote.
NotFound

createPoll

Creates a new poll. The objectType should be a valid constant from the JiveConstants class, and the objectID should be a valid ID for the given object type.

POST http://domain:port/application_context/rpc/rest/pollService/polls

Arguments

Name Type Description
objectType xs:int The object type of the object the poll is associated with.
objectID xs:long The objectID of the object the poll is associated with.
userID xs:long The userID creating the poll or null if is an anonymous user.
name xs:string The poll's name, usually the poll's question.

Arguments Template

<createPoll> 
    <objectType>xs:int</objectType>
    <objectID>xs:long</objectID>
    <userID>xs:long</userID>
    <name>xs:string</name>
</createPoll>

Response

Type Description
Poll A new Poll object.

Response Template

<createPollResponse> 
    <return>
        <!-- Contents of Poll -->
    <return>
</createPollResponse>

Errors

Error When Returned
UserNotFound If the specified user doesn't exist.
Unauthorized If the caller has no permissions to create a poll.

deleteOption

Remove an option from the poll.

DELETE http://domain:port/application_context/rpc/rest/pollService/options/{pollID}/{index}

Arguments

Name Type Description
pollID xs:long
index xs:int

Arguments Template

<deleteOption> 
    <pollID>xs:long</pollID>
    <index>xs:int</index>
</deleteOption>

Errors

Error When Returned
Unauthorized if the user does not have permissions to administer the poll.
NotFound

deletePoll

Deletes the specified poll.

DELETE http://domain:port/application_context/rpc/rest/pollService/polls/{pollID}

Arguments

Name Type Description
pollID xs:long ID of the poll to delete.

Arguments Template

<deletePoll> 
    <pollID>xs:long</pollID>
</deletePoll>

Errors

Error When Returned
Unauthorized If the caller has no permissions to delete the poll.
com.jivesoftware.community.PollException If the poll could not be deleted.
NotFound If the poll was not found.

getActivePollCount

Returns a count of all active polls in the system. Active polls are defined as polls where the current date is between the poll's start and expire dates.

GET http://domain:port/application_context/rpc/rest/pollService/activePollCount

Response

Type Description
xs:int A count of all active polls in the system.

Response Template

<getActivePollCountResponse> 
    <return>xs:int</return>
</getActivePollCountResponse>

getActivePollCountByObjectTypeAndObjectID

Returns a count of all active polls of a given type and object ID. Active polls are defined as polls where the current date is between the poll's start and expiration dates.

GET http://domain:port/application_context/rpc/rest/pollService/activePollCount/{objectType}/{objectID}

Arguments

Name Type Description
objectType xs:int The type of object we're looking at (defined in the JiveConstants class.
objectID xs:long the ID of the object we're looking at.

Arguments Template

<getActivePollCountByObjectTypeAndObjectID> 
    <objectType>xs:int</objectType>
    <objectID>xs:long</objectID>
</getActivePollCountByObjectTypeAndObjectID>

Response

Type Description
xs:int a count of all active polls for the given object.

Response Template

<getActivePollCountByObjectTypeAndObjectIDResponse> 
    <return>xs:int</return>
</getActivePollCountByObjectTypeAndObjectIDResponse>

getActivePolls

Returns an iterable of active polls in the system. Active polls are defined as polls where the current date is between the poll's start and expiration dates.

GET http://domain:port/application_context/rpc/rest/pollService/activePolls

Response

Type Description
List of Poll A list of active polls in the system.

Response Template

<getActivePollsResponse> 
    <!-- List of ... -->
    <return>
        <!-- Contents of Poll -->
    <return>
</getActivePollsResponse>

getActivePollsByObjectTypeAndObjectID

Returns a list of active polls associated with the object specified by the objectType and objectID. Active polls are defined as polls where the current date is between the poll's start and expiration dates.

GET http://domain:port/application_context/rpc/rest/pollService/activePolls/{objectType}/{objectID}

Arguments

Name Type Description
objectType xs:int The object type of the object the poll is associated with.
objectID xs:long The objectID of the object the poll is associated with.

Arguments Template

<getActivePollsByObjectTypeAndObjectID> 
    <objectType>xs:int</objectType>
    <objectID>xs:long</objectID>
</getActivePollsByObjectTypeAndObjectID>

Response

Type Description
List of Poll A list of poll objects for active polls associated with the object specified by the objectType and objectID.

Response Template

<getActivePollsByObjectTypeAndObjectIDResponse> 
    <!-- List of ... -->
    <return>
        <!-- Contents of Poll -->
    <return>
</getActivePollsByObjectTypeAndObjectIDResponse>

Errors

Error When Returned
Unauthorized If the caller has no permissions to view polls for the specified objectType and objectID.

getAnonymousVoteCount

Returns a count of all guests user votes for all options in the poll.

GET http://domain:port/application_context/rpc/rest/pollService/votes/anonymousCount/{pollID}

Arguments

Name Type Description
pollID xs:long

Arguments Template

<getAnonymousVoteCount> 
    <pollID>xs:long</pollID>
</getAnonymousVoteCount>

Response

Type Description
xs:int a count of all guest votes for all options in the poll.

Response Template

<getAnonymousVoteCountResponse> 
    <return>xs:int</return>
</getAnonymousVoteCountResponse>

Errors

Error When Returned
com.jivesoftware.community.PollException reserved for future changes.
NotFound
Unauthorized if no permissions to view the poll.

getAnonymousVoteCountByIndex

Returns a count of all user votes for the specified option in the poll.

GET http://domain:port/application_context/rpc/rest/pollService/votes/anonymousCount/{pollID}/{index}

Arguments

Name Type Description
pollID xs:long
index xs:int

Arguments Template

<getAnonymousVoteCountByIndex> 
    <pollID>xs:long</pollID>
    <index>xs:int</index>
</getAnonymousVoteCountByIndex>

Response

Type Description
xs:int a count of all user votes for the specified option in the poll.

Response Template

<getAnonymousVoteCountByIndexResponse> 
    <return>xs:int</return>
</getAnonymousVoteCountByIndexResponse>

Errors

Error When Returned
com.jivesoftware.community.PollException reserved for future changes.
NotFound
Unauthorized if no permissions to view the poll.

getAnonymousVoteIndices

Returns a list of option indexes corresponding to the anonymous votes, or an empty array if the user has not voted.

GET http://domain:port/application_context/rpc/rest/pollService/votes/anonymousIndices/{pollID}/{uniqueID}

Arguments

Name Type Description
pollID xs:long a uniqueID for the guest.
uniqueID xs:string

Arguments Template

<getAnonymousVoteIndices> 
    <pollID>xs:long</pollID>
    <uniqueID>xs:string</uniqueID>
</getAnonymousVoteIndices>

Response

Type Description
List of a list of option indexes (as Integers) corresponding to the anonymous votes.

Response Template

<getAnonymousVoteIndicesResponse> 
    <!-- List of ... -->
    <return>xs:int</return>
</getAnonymousVoteIndicesResponse>

Errors

Error When Returned
NotFound
Unauthorized if no permissions to view the poll.

getAnonymousVotes

Returns a list of uniqueID's for guests who have voted for the option at the given index.

GET http://domain:port/application_context/rpc/rest/pollService/votes/anonymous/{pollID}

Arguments

Name Type Description
pollID xs:long

Arguments Template

<getAnonymousVotes> 
    <pollID>xs:long</pollID>
</getAnonymousVotes>

Response

Type Description
List of an Iterator of uniqueID's for guests who have voted for the option at the given index.

Response Template

<getAnonymousVotesResponse> 
    <!-- List of ... -->
    <return>xs:string</return>
</getAnonymousVotesResponse>

Errors

Error When Returned
com.jivesoftware.community.PollException reserved for future changes.
NotFound
Unauthorized if no permissions to view the poll.

getAnonymousVotesByIndex

Returns an Iterator of uniqueID's for guests who have voted for the option at the given index.

GET http://domain:port/application_context/rpc/rest/pollService/votes/anonymous/{pollID}/{index}

Arguments

Name Type Description
pollID xs:long the index to return the voting guests for.
index xs:int

Arguments Template

<getAnonymousVotesByIndex> 
    <pollID>xs:long</pollID>
    <index>xs:int</index>
</getAnonymousVotesByIndex>

Response

Type Description
List of an Iterator of uniqueID's for guests who have voted for the option at the given index.

Response Template

<getAnonymousVotesByIndexResponse> 
    <!-- List of ... -->
    <return>xs:string</return>
</getAnonymousVotesByIndexResponse>

Errors

Error When Returned
com.jivesoftware.community.PollException reserved for future changes.
NotFound
Unauthorized if no permissions to view the poll.

getLivePollCount

Returns a count of all live polls in the system. Live polls are defined as polls where the current date is between the poll's start and end dates.

GET http://domain:port/application_context/rpc/rest/pollService/livePollCount

Response

Type Description
xs:int a count of all live polls in the system.

Response Template

<getLivePollCountResponse> 
    <return>xs:int</return>
</getLivePollCountResponse>

getLivePollCountByObjectTypeAndObjectID

Returns a count of all live polls of a given type and object ID. Live polls are defined as polls where the current date is between the poll's start and end dates.

GET http://domain:port/application_context/rpc/rest/pollService/livePollCount/{objectType}/{objectID}

Arguments

Name Type Description
objectType xs:int the type of object we're looking at (defined in the JiveConstants class.
objectID xs:long the ID of the object we're looking at.

Arguments Template

<getLivePollCountByObjectTypeAndObjectID> 
    <objectType>xs:int</objectType>
    <objectID>xs:long</objectID>
</getLivePollCountByObjectTypeAndObjectID>

Response

Type Description
xs:int a count of all live polls for the given object.

Response Template

<getLivePollCountByObjectTypeAndObjectIDResponse> 
    <return>xs:int</return>
</getLivePollCountByObjectTypeAndObjectIDResponse>

Errors

Error When Returned
Unauthorized if not allowed

getLivePolls

Returns a List of live polls in the system. Live polls are defined as polls where the current date is between the poll's start and end dates.

GET http://domain:port/application_context/rpc/rest/pollService/livePolls

Response

Type Description
List of Poll an iterable of live polls in the system.

Response Template

<getLivePollsResponse> 
    <!-- List of ... -->
    <return>
        <!-- Contents of Poll -->
    <return>
</getLivePollsResponse>

getLivePollsByObjectTypeAndObjectID

Returns an iterable of live polls associated with the object specified by the objectType and objectID. Live polls are defined as polls where the current date is between the poll's start and end dates.

GET http://domain:port/application_context/rpc/rest/pollService/livePolls/{objectType}/{objectID}

Arguments

Name Type Description
objectType xs:int the object type of the object the poll is associated with.
objectID xs:long the objectID of the object the poll is associated with.

Arguments Template

<getLivePollsByObjectTypeAndObjectID> 
    <objectType>xs:int</objectType>
    <objectID>xs:long</objectID>
</getLivePollsByObjectTypeAndObjectID>

Response

Type Description
List of Poll an iterable of Poll objects for live polls associated with the object specified by the objectType and objectID.

Response Template

<getLivePollsByObjectTypeAndObjectIDResponse> 
    <!-- List of ... -->
    <return>
        <!-- Contents of Poll -->
    <return>
</getLivePollsByObjectTypeAndObjectIDResponse>

Errors

Error When Returned
Unauthorized if no permissions to view polls for the specified objectType and objectID.

getPoll

Returns the specified poll.

GET http://domain:port/application_context/rpc/rest/pollService/polls/{pollID}

Arguments

Name Type Description
pollID xs:long ID of the poll to return.

Arguments Template

<getPoll> 
    <pollID>xs:long</pollID>
</getPoll>

Response

Type Description
Poll The poll specified by pollID.

Response Template

<getPollResponse> 
    <return>
        <!-- Contents of Poll -->
    <return>
</getPollResponse>

Errors

Error When Returned
Unauthorized If the caller has no permissions to view the poll.
NotFound If the poll of the given ID was not found.

getPollCount

Returns a count of all polls, both active and inactive.

GET http://domain:port/application_context/rpc/rest/pollService/pollCount

Response

Type Description
xs:int A count of all polls, both active and inactive.

Response Template

<getPollCountResponse> 
    <return>xs:int</return>
</getPollCountResponse>

getPollCountByObjectTypeAndObjectID

Returns a count of polls, both active and inactive, associated with the object specified by the objectType and objectID.

GET http://domain:port/application_context/rpc/rest/pollService/pollCount/{objectType}/{objectID}

Arguments

Name Type Description
objectType xs:int The object type of the object the poll is associated with.
objectID xs:long The objectID of the object the poll is associated with.

Arguments Template

<getPollCountByObjectTypeAndObjectID> 
    <objectType>xs:int</objectType>
    <objectID>xs:long</objectID>
</getPollCountByObjectTypeAndObjectID>

Response

Type Description
xs:int A count of polls, both active and inactive, associated with the object specified by the objectType and objectID.

Response Template

<getPollCountByObjectTypeAndObjectIDResponse> 
    <return>xs:int</return>
</getPollCountByObjectTypeAndObjectIDResponse>

Errors

Error When Returned
Unauthorized If the caller has no permissions to view polls for the specified objectType and objectID.

getPolls

Returns a list of all polls, both active and inactive. The ordering of the polls is from active to inactive polls, and then from newest to oldest in each group.

GET http://domain:port/application_context/rpc/rest/pollService/polls

Response

Type Description
List of Poll A list of all polls, both active and inactive.

Response Template

<getPollsResponse> 
    <!-- List of ... -->
    <return>
        <!-- Contents of Poll -->
    <return>
</getPollsResponse>

getPollsByObjectTypeAndObjectID

Returns a list of polls, both active and inactive, associated with the object specified by the objectType and objectID.

GET http://domain:port/application_context/rpc/rest/pollService/polls/{objectType}/{objectID}

Response

Type Description
List of Poll A list of poll objects for polls, both active and inactive, associated with the object specified by the objectType and objectID.

Response Template

<getPollsByObjectTypeAndObjectIDResponse> 
    <!-- List of ... -->
    <return>
        <!-- Contents of Poll -->
    <return>
</getPollsByObjectTypeAndObjectIDResponse>

Errors

Error When Returned
Unauthorized If the caller has no permissions to view polls for the specified objectType and objectID.

getUserVoteCount

Returns a count of all user votes for all options in the poll.

GET http://domain:port/application_context/rpc/rest/pollService/votes/userCount/{pollID}

Arguments

Name Type Description
pollID xs:long

Arguments Template

<getUserVoteCount> 
    <pollID>xs:long</pollID>
</getUserVoteCount>

Response

Type Description
xs:int a count of all user votes for all options in the poll.

Response Template

<getUserVoteCountResponse> 
    <return>xs:int</return>
</getUserVoteCountResponse>

Errors

Error When Returned
com.jivesoftware.community.PollException reserved for future changes.
NotFound
Unauthorized if no permissions to view the poll.

getUserVoteCountByIndex

Returns a count of all user votes for the specified option in the poll.

GET http://domain:port/application_context/rpc/rest/pollService/votes/userCount/{pollID}/{index}

Arguments

Name Type Description
pollID xs:long
index xs:int

Arguments Template

<getUserVoteCountByIndex> 
    <pollID>xs:long</pollID>
    <index>xs:int</index>
</getUserVoteCountByIndex>

Response

Type Description
xs:int a count of all user votes for the specified option in the poll.

Response Template

<getUserVoteCountByIndexResponse> 
    <return>xs:int</return>
</getUserVoteCountByIndexResponse>

Errors

Error When Returned
com.jivesoftware.community.PollException reserved for future changes.
NotFound
Unauthorized if no permissions to view the poll.

getUserVoteIndices

Returns a list of option indexes corresponding to the user votes, or an empty array if the user has not voted.

GET http://domain:port/application_context/rpc/rest/pollService/votes/userIndices/{pollID}/{userID}

Arguments

Name Type Description
pollID xs:long the user to return the indexes of options the user has voted for.
userID xs:long

Arguments Template

<getUserVoteIndices> 
    <pollID>xs:long</pollID>
    <userID>xs:long</userID>
</getUserVoteIndices>

Response

Type Description
List of a list of option indexes (as Integers) corresponding to the user votes. @param pollID of the poll we're querying on

Response Template

<getUserVoteIndicesResponse> 
    <!-- List of ... -->
    <return>xs:int</return>
</getUserVoteIndicesResponse>

Errors

Error When Returned
NotFound
Unauthorized if no permissions to view the poll.

getUserVotes

Returns a List of User objects for users who have voted for any options in the poll.

GET http://domain:port/application_context/rpc/rest/pollService/votes/{pollID}

Arguments

Name Type Description
pollID xs:long

Arguments Template

<getUserVotes> 
    <pollID>xs:long</pollID>
</getUserVotes>

Response

Type Description
List of User an Iterator of users who have voted for any option in the poll

Response Template

<getUserVotesResponse> 
    <!-- List of ... -->
    <return>
        <!-- Contents of User -->
    <return>
</getUserVotesResponse>

Errors

Error When Returned
com.jivesoftware.community.PollException reserved for future changes.
NotFound
Unauthorized if no permissions to view the poll.

getUserVotesByIndex

Returns a list of User objects for users who have voted for the option at the given index.

GET http://domain:port/application_context/rpc/rest/pollService/votes/{pollID}/{index}

Arguments

Name Type Description
pollID xs:long the index to return the voting users for.
index xs:int

Arguments Template

<getUserVotesByIndex> 
    <pollID>xs:long</pollID>
    <index>xs:int</index>
</getUserVotesByIndex>

Response

Type Description
List of User an Iterator of users who have voted for the option at the given index.

Response Template

<getUserVotesByIndexResponse> 
    <!-- List of ... -->
    <return>
        <!-- Contents of User -->
    <return>
</getUserVotesByIndexResponse>

Errors

Error When Returned
com.jivesoftware.community.PollException reserved for future changes.
NotFound
Unauthorized if no permissions to view the poll.

getVoteCount

Returns a count of all votes (both guest and user votes) for all options in the poll.

GET http://domain:port/application_context/rpc/rest/pollService/votes/count/{pollID}

Arguments

Name Type Description
pollID xs:long

Arguments Template

<getVoteCount> 
    <pollID>xs:long</pollID>
</getVoteCount>

Response

Type Description
xs:int a count of all votes for all options in the poll.

Response Template

<getVoteCountResponse> 
    <return>xs:int</return>
</getVoteCountResponse>

Errors

Error When Returned
com.jivesoftware.community.PollException reserved for future changes.
NotFound
Unauthorized if no permissions to view the poll.

getVoteCountByIndex

Returns a count of all votes (both guest and user votes) for the specified option in the poll.

GET http://domain:port/application_context/rpc/rest/pollService/votesByIndex/{pollID}/{index}

Arguments

Name Type Description
pollID xs:long
index xs:int

Arguments Template

<getVoteCountByIndex> 
    <pollID>xs:long</pollID>
    <index>xs:int</index>
</getVoteCountByIndex>

Response

Type Description
xs:int a count of all votes for the specified option in the poll.

Response Template

<getVoteCountByIndexResponse> 
    <return>xs:int</return>
</getVoteCountByIndexResponse>

Errors

Error When Returned
com.jivesoftware.community.PollException reserved for future changes.
NotFound
Unauthorized if no permissions to view the poll.

hasAnonymousVoted

Returns true if the guest associated with the uniqueID has previously voted in the poll, false otherwise.

GET http://domain:port/application_context/rpc/rest/pollService/votes/anonymousVoted/{pollID}/{uniqueID}

Arguments

Name Type Description
pollID xs:long the uniqueID of the guest to check to see if they've voted already.
uniqueID xs:string

Arguments Template

<hasAnonymousVoted> 
    <pollID>xs:long</pollID>
    <uniqueID>xs:string</uniqueID>
</hasAnonymousVoted>

Response

Type Description
xs:boolean true if the guest specified has previously voted in the poll, false otherwise.

Response Template

<hasAnonymousVotedResponse> 
    <return>xs:boolean</return>
</hasAnonymousVotedResponse>

Errors

Error When Returned
NotFound
Unauthorized if no permissions to view the poll.

hasUserVoted

Returns true if the user specified has previously voted in the poll, false otherwise.

GET http://domain:port/application_context/rpc/rest/pollService/votes/userVoted/{pollID}/{userID}

Arguments

Name Type Description
pollID xs:long id of the user to check to see if they've voted already.
userID xs:long

Arguments Template

<hasUserVoted> 
    <pollID>xs:long</pollID>
    <userID>xs:long</userID>
</hasUserVoted>

Response

Type Description
xs:boolean true if the user specified has previously voted in the poll, false otherwise.

Response Template

<hasUserVotedResponse> 
    <return>xs:boolean</return>
</hasUserVotedResponse>

Errors

Error When Returned
NotFound
Unauthorized if no permissions to view the poll.

isModeEnabled

Returns true if the mode specified is enabled for the poll, false otherwise. Valid modes are defined as static final constants in this interface.

GET http://domain:port/application_context/rpc/rest/pollService/modes/{pollID}/{mode}

Arguments

Name Type Description
pollID xs:long a valid poll mode
mode xs:long of the poll we're querying

Arguments Template

<isModeEnabled> 
    <pollID>xs:long</pollID>
    <mode>xs:long</mode>
</isModeEnabled>

Response

Type Description
xs:boolean true if the mode specified is enabled for the poll, false otherwise.

Response Template

<isModeEnabledResponse> 
    <return>xs:boolean</return>
</isModeEnabledResponse>

Errors

Error When Returned
NotFound
Unauthorized if no permissions to view the poll.

removeAnonymousVote

Remove a guest vote. This method will throw a PollException unless the mode 'ALLOW_ANONYMOUS_VOTE_MODIFICATION' is enabled for the poll.

DELETE http://domain:port/application_context/rpc/rest/pollService/votes/anonymous/{pollID}/{prevOptionIndex}/{uniqueID}

Arguments

Name Type Description
pollID xs:long the index of the option to remove the vote from.
prevOptionIndex xs:int a uniqueID for the guest.
uniqueID xs:string

Arguments Template

<removeAnonymousVote> 
    <pollID>xs:long</pollID>
    <prevOptionIndex>xs:int</prevOptionIndex>
    <uniqueID>xs:string</uniqueID>
</removeAnonymousVote>

Errors

Error When Returned
com.jivesoftware.community.PollException if the poll is not active, the guest did not vote for the prevOptionIndex or vote modification is not enabled for guests.
Unauthorized if the guest does not have permission to vote.
NotFound

removeUserVote

Remove a user vote. This method will throw a PollException unless the mode 'ALLOW_USER_VOTE_MODIFICATION' is enabled for the poll.

DELETE http://domain:port/application_context/rpc/rest/pollService/votes/user/{pollID}/{prevOptionIndex}/{userID}

Arguments

Name Type Description
pollID xs:long the index of the option to remove the vote from.
prevOptionIndex xs:int
userID xs:long

Arguments Template

<removeUserVote> 
    <pollID>xs:long</pollID>
    <prevOptionIndex>xs:int</prevOptionIndex>
    <userID>xs:long</userID>
</removeUserVote>

Errors

Error When Returned
com.jivesoftware.community.PollException if the poll is not active, the user did not vote for the prevOptionIndex or vote modification is not enabled for users.
Unauthorized if the user does not have permission to vote.
NotFound

setMode

Sets a mode to be enabled or disabled for the poll. Valid modes are defined as static final constants in this interface.

POST http://domain:port/application_context/rpc/rest/pollService/modes

Arguments

Name Type Description
pollID xs:long a valid mode
mode xs:long true if the poll should be enabled, false if not
enabled xs:boolean

Arguments Template

<setMode> 
    <pollID>xs:long</pollID>
    <mode>xs:long</mode>
    <enabled>xs:boolean</enabled>
</setMode>

Errors

Error When Returned
Unauthorized if the user does not have permissions to administer the poll.
NotFound

setOption

Sets the text of the option at the specified index.

PUT http://domain:port/application_context/rpc/rest/pollService/options

Arguments

Name Type Description
pollID xs:long the index of the option to set the text for.
index xs:int the new text for the option.
value xs:string

Arguments Template

<setOption> 
    <pollID>xs:long</pollID>
    <index>xs:int</index>
    <value>xs:string</value>
</setOption>

Errors

Error When Returned
Unauthorized if the user does not have permissions to administer the poll.
NotFound

setOptionIndex

Moves the option's index.

PUT http://domain:port/application_context/rpc/rest/pollService/options/index

Arguments

Name Type Description
pollID xs:long the current index of the option.
currentIndex xs:int the new index of the option.
newIndex xs:int

Arguments Template

<setOptionIndex> 
    <pollID>xs:long</pollID>
    <currentIndex>xs:int</currentIndex>
    <newIndex>xs:int</newIndex>
</setOptionIndex>

Errors

Error When Returned
Unauthorized if the user does not have permissions to administer the poll.
NotFound

update

Update the poll.

PUT http://domain:port/application_context/rpc/rest/pollService/polls

Arguments

Name Type Description
poll Contents of Poll the poll with the new information.

Arguments Template

<update> 
    <poll>
        <!-- Contents of Poll -->
    <poll>
</update>

Errors

Error When Returned
NotFound if poll is not found.
Unauthorized if the user does not have permissions to administer the poll.