Verint | Telligent Community
Verint | Telligent Community
  • Site
  • User
  • Site
  • Search
  • User
Verint Community 12.x
  • Verint Community
Verint Community 12.x
API Documentation Create Poll Item Vote REST Endpoint
  • User Documentation
  • Ask the Community
  • API Documentation
  • Manager Training
  • Developer Training
  • Tags
  • More
  • Cancel
  • New

Create Poll Item Vote REST Endpoint


URLs

POST api.ashx/v2/forums/{forumid}/threads/{threadid}/pollitems/votes/{answerid}.xml (or .json)

CREATE a vote on a poll item for a user. Deprecated in 8.5, use POST /poll/{id}/vote.{format} instead.

Request Parameters

NameTypeDescriptionRequiredDefaultOptions
ForumIdintForum IdRequired
ThreadIdintThread IdRequired
AnswerIdstringAnswer IdRequired

Example Requests

C# REST SDK

This example uses the REST SDK to access the Community REST API within a .Net C# application. In the example, USER_NAME is the user name of the effective user for the request and OAUTH_CLIENT_ID and OAUTH_SECRET are the OAuth client ID and secret, respectively, associated to this application as configured in Administration > Integration > OAuth Clients with the "Client Credentials" grant type enabled. See the documentation for the REST SDK for more details about installation, configuration, and usage options.

var host = new ClientCredentialsRestHost("USER_NAME", "https://mysite.com/", "OAUTH_CLIENT_ID", "OAUTH_SECRET");
var response = host.PostToDynamic(2, "forums/{forumid}/threads/{threadid}/pollitems/votes/{answerid}.json", false, new RestPostOptions {
	PathParameters = new System.Collections.Specialized.NameValueCollection {
		{ "forumid", "6" },
		{ "threadid", "6" },
		{ "answerid", "answerid" }
	}
});

Widget Javascript

This example uses the rest JavaScript API to access the Community REST API within the Community web UI. When accessing the REST API through the javascript API, the effective user is the current contextual user of the web interface.

jQuery.telligent.evolution.post({
	url: jQuery.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/forums/{forumid}/threads/{threadid}/pollitems/votes/{answerid}.json',
	data: { 
		'forumid': '6',
		'threadid': '6',
		'answerid': 'answerid'
	},
	success: function(response) {

	}
});

cURL

This example uses the cURL command-line HTTP utility. ENCODED_TOKEN in the example is the base64-encoded concatenation of the user's API key (created from the user's profile), a colon (:), and the user's user name. Learn more about using the REST API.

curl -H "Rest-User-Token: ENCODED_TOKEN" -X POST https://mysite.com/api.ashx/v2/forums/6/threads/6/pollitems/votes/answerid.xml

Example Responses

XML

<?xml version="1.0" encoding="utf-16"?>
<Response>
  <Info>
    <Message>string</Message>
    <Message>string</Message>
  </Info>
  <Warnings>
    <Message>string</Message>
    <Message>string</Message>
  </Warnings>
  <Errors>
    <Message>string</Message>
    <Message>string</Message>
  </Errors>
  <PollItem>
    <AnswerId>answerid</AnswerId>
    <Answer>answer</Answer>
    <OrderNumber>6</OrderNumber>
    <Total>25</Total>
  </PollItem>
</Response>

JSON

{
  "PollItem": {
    "AnswerId": "answerid",
    "Answer": "answer",
    "OrderNumber": 6,
    "Total": 25
  },
  "Info": [
    "string",
    "string"
  ],
  "Warnings": [
    "string",
    "string"
  ],
  "Errors": [
    "string",
    "string"
  ]
}

  • Share
  • History
  • More
  • Cancel
Related
Recommended
  • Telligent
  • Professional Services
  • Submit a Support Ticket
  • Become a Partner
  • Request a Demo
  • Contact Us

About
Privacy Policy
Terms of use
Copyright 2024 Verint, Inc.
Powered by Verint Community