Request Parameters
Name | Type | Description | Location | Required | Default | Options |
---|---|---|---|---|---|---|
IdeaId | Guid | Id of idea | Query String | Required | ||
UserId | int | Id of voting user | Query String | Required |
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.GetToDynamic(2, "ideas/vote.json", false, new RestGetOptions { QueryStringParameters = new System.Collections.Specialized.NameValueCollection { { "IdeaId", "49fec544-6df7-4a82-872b-f8be586d5e9e" }, { "UserId", "6" } } });
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.get({ url: jQuery.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/ideas/vote.json', data: { 'IdeaId': '49fec544-6df7-4a82-872b-f8be586d5e9e', 'UserId': '6' }, 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 GET https://mysite.com/api.ashx/v2/ideas/vote.xml?IdeaId=49fec544-6df7-4a82-872b-f8be586d5e9e&UserId=6
Example Responses
XML
<?xml version="1.0" encoding="utf-16"?> <Response> <Vote> <Idea> <Id>49fec544-6df7-4a82-872b-f8be586d5e9e</Id> <ContentId>9f5a6721-639d-4e1d-ab6a-ce63b7750f46</ContentId> <ContentTypeId>fe65240b-044c-4292-9946-f10e0361ecff</ContentTypeId> <Challenge> <Id>2d525bad-c4df-470d-a193-a1c6d66e5c3e</Id> <Group> <Name>name</Name> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> <Id>6</Id> </Group> <ApplicationId>bd519379-b61f-4e2f-b0f9-c0f28c5cceb1</ApplicationId> <ApplicationTypeId>9ba1ec43-dc34-4e27-a579-4a0855144e2f</ApplicationTypeId> <Name>name</Name> <Description>description</Description> <ApplicationKey>applicationkey</ApplicationKey> <CreatedDate>2012-01-04T00:00:00</CreatedDate> <IsEnabled>true</IsEnabled> <TotalPosts>25</TotalPosts> <LastPostDate>2012-05-02T00:00:00</LastPostDate> <MaximumVotesPerUser>8</MaximumVotesPerUser> <MaximumVotesPerIdea>4</MaximumVotesPerIdea> <RequiresCategory>true</RequiresCategory> <AllowMultipleVotes>true</AllowMultipleVotes> </Challenge> <Name>name</Name> <Description>description</Description> <Status> <Key>key</Key> <Name>name</Name> <Description>description</Description> <SortOrder>7</SortOrder> <IsDefault>true</IsDefault> <IsClosed>true</IsClosed> <ReleasesVotes>true</ReleasesVotes> <ScoreValue>0</ScoreValue> </Status> <StatusNotes>statusnotes</StatusNotes> <StatusAuthorUser> <DisplayName>displayname</DisplayName> <Username>username</Username> <ProfileUrl>profileurl</ProfileUrl> <AvatarUrl>avatarurl</AvatarUrl> <UserId>27</UserId> </StatusAuthorUser> <StatusDate>2012-06-04T00:00:00</StatusDate> <AuthorUser> <DisplayName>displayname</DisplayName> <Username>username</Username> <ProfileUrl>profileurl</ProfileUrl> <AvatarUrl>avatarurl</AvatarUrl> <UserId>32</UserId> </AuthorUser> <CreatedDate>2011-05-28T00:00:00</CreatedDate> <LastUpdatedDate>2011-12-09T00:00:00</LastUpdatedDate> <IsEnabled>true</IsEnabled> <Url>url</Url> <Category> <IdeationId>e3715662-2528-4ba1-84a7-bfcd9d548f80</IdeationId> <Id>52</Id> <Name>name</Name> </Category> <TotalVotes>19</TotalVotes> <YesVotes>112</YesVotes> <NoVotes>61</NoVotes> <Score>18</Score> <CurrentStatus> <Id>76</Id> <Idea> <Id>6cdcf200-3bad-476d-af45-97b52545c337</Id> <ContentId>b04540ec-eb38-4fa1-b7bb-e3fde05401b4</ContentId> <ContentTypeId>44df201a-07e6-42eb-96c7-8ce7ce35aab6</ContentTypeId> <Challenge> <Id>49fec544-6df7-4a82-872b-f8be586d5e9e</Id> <Group> <Name>name</Name> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> <Id>6</Id> </Group> <ApplicationId>9f5a6721-639d-4e1d-ab6a-ce63b7750f46</ApplicationId> <ApplicationTypeId>fe65240b-044c-4292-9946-f10e0361ecff</ApplicationTypeId> <Name>name</Name> <Description>description</Description> <ApplicationKey>applicationkey</ApplicationKey> <CreatedDate>2012-03-29T00:00:00</CreatedDate> <IsEnabled>true</IsEnabled> <TotalPosts>25</TotalPosts> <LastPostDate>2012-04-19T00:00:00</LastPostDate> <MaximumVotesPerUser>8</MaximumVotesPerUser> <MaximumVotesPerIdea>4</MaximumVotesPerIdea> <RequiresCategory>true</RequiresCategory> <AllowMultipleVotes>true</AllowMultipleVotes> </Challenge> <Name>name</Name> <Description>description</Description> <Status> <Key>key</Key> <Name>name</Name> <Description>description</Description> <SortOrder>7</SortOrder> <IsDefault>true</IsDefault> <IsClosed>true</IsClosed> <ReleasesVotes>true</ReleasesVotes> <ScoreValue>0</ScoreValue> </Status> <StatusNotes>statusnotes</StatusNotes> <StatusAuthorUser> <DisplayName>displayname</DisplayName> <Username>username</Username> <ProfileUrl>profileurl</ProfileUrl> <AvatarUrl>avatarurl</AvatarUrl> <UserId>27</UserId> </StatusAuthorUser> <StatusDate>2012-01-16T00:00:00</StatusDate> <AuthorUser> <DisplayName>displayname</DisplayName> <Username>username</Username> <ProfileUrl>profileurl</ProfileUrl> <AvatarUrl>avatarurl</AvatarUrl> <UserId>32</UserId> </AuthorUser> <CreatedDate>2012-01-04T00:00:00</CreatedDate> <LastUpdatedDate>2012-05-02T00:00:00</LastUpdatedDate> <IsEnabled>true</IsEnabled> <Url>url</Url> <Category> <IdeationId>2d525bad-c4df-470d-a193-a1c6d66e5c3e</IdeationId> <Id>52</Id> <Name>name</Name> </Category> <TotalVotes>19</TotalVotes> <YesVotes>112</YesVotes> <NoVotes>61</NoVotes> <Score>18</Score> <CurrentStatus> <Id>76</Id> <Idea> <Id>bd519379-b61f-4e2f-b0f9-c0f28c5cceb1</Id> <ContentId>9ba1ec43-dc34-4e27-a579-4a0855144e2f</ContentId> <ContentTypeId>e3715662-2528-4ba1-84a7-bfcd9d548f80</ContentTypeId> <Name>name</Name> <Description>description</Description> <StatusNotes>statusnotes</StatusNotes> <StatusDate /> <CreatedDate>2012-06-04T00:00:00</CreatedDate> <LastUpdatedDate>2011-05-28T00:00:00</LastUpdatedDate> <IsEnabled>true</IsEnabled> <Url>url</Url> <TotalVotes>6</TotalVotes> <YesVotes>25</YesVotes> <NoVotes>8</NoVotes> <Score>4</Score> </Idea> <Status> <Key>key</Key> <Name>name</Name> <Description>description</Description> <SortOrder>7</SortOrder> <IsDefault>true</IsDefault> <IsClosed>true</IsClosed> <ReleasesVotes>true</ReleasesVotes> <ScoreValue>0</ScoreValue> </Status> <Author> <DisplayName>displayname</DisplayName> <Username>username</Username> <ProfileUrl>profileurl</ProfileUrl> <AvatarUrl>avatarurl</AvatarUrl> <UserId>27</UserId> </Author> <CreatedDate>2011-12-09T00:00:00</CreatedDate> <Note>note</Note> </CurrentStatus> </Idea> <Status> <Key>key</Key> <Name>name</Name> <Description>description</Description> <SortOrder>32</SortOrder> <IsDefault>true</IsDefault> <IsClosed>true</IsClosed> <ReleasesVotes>true</ReleasesVotes> <ScoreValue>0</ScoreValue> </Status> <Author> <DisplayName>displayname</DisplayName> <Username>username</Username> <ProfileUrl>profileurl</ProfileUrl> <AvatarUrl>avatarurl</AvatarUrl> <UserId>52</UserId> </Author> <CreatedDate>2012-03-29T00:00:00</CreatedDate> <Note>note</Note> </CurrentStatus> </Idea> <User> <DisplayName>displayname</DisplayName> <Username>username</Username> <ProfileUrl>profileurl</ProfileUrl> <AvatarUrl>avatarurl</AvatarUrl> <UserId>19</UserId> </User> <Value>true</Value> <TotalVotes>112</TotalVotes> </Vote> <Errors> <Message>string</Message> <Message>string</Message> </Errors> </Response>
JSON
{ "Vote": { "Idea": { "Id": "49fec544-6df7-4a82-872b-f8be586d5e9e", "ContentId": "9f5a6721-639d-4e1d-ab6a-ce63b7750f46", "ContentTypeId": "fe65240b-044c-4292-9946-f10e0361ecff", "Challenge": { "Id": "2d525bad-c4df-470d-a193-a1c6d66e5c3e", "Group": { "Name": "name", "Url": "url", "AvatarUrl": "avatarurl", "Id": 6 }, "ApplicationId": "bd519379-b61f-4e2f-b0f9-c0f28c5cceb1", "ApplicationTypeId": "9ba1ec43-dc34-4e27-a579-4a0855144e2f", "Name": "name", "Description": "description", "ApplicationKey": "applicationkey", "CreatedDate": "2012-01-04T00:00:00", "IsEnabled": true, "TotalPosts": 25, "LastPostDate": "2012-05-02T00:00:00", "MaximumVotesPerUser": 8, "MaximumVotesPerIdea": 4, "RequiresCategory": true, "AllowMultipleVotes": true }, "Name": "name", "Description": "description", "Status": { "Key": "key", "Name": "name", "Description": "description", "SortOrder": 7, "IsDefault": true, "IsClosed": true, "ReleasesVotes": true, "ScoreValue": 0 }, "StatusNotes": "statusnotes", "StatusAuthorUser": { "DisplayName": "displayname", "Username": "username", "ProfileUrl": "profileurl", "AvatarUrl": "avatarurl", "UserId": 27 }, "StatusDate": "2012-06-04T00:00:00", "AuthorUser": { "DisplayName": "displayname", "Username": "username", "ProfileUrl": "profileurl", "AvatarUrl": "avatarurl", "UserId": 32 }, "CreatedDate": "2011-05-28T00:00:00", "LastUpdatedDate": "2011-12-09T00:00:00", "IsEnabled": true, "Url": "url", "Category": { "IdeationId": "e3715662-2528-4ba1-84a7-bfcd9d548f80", "Id": 52, "Name": "name" }, "TotalVotes": 19, "YesVotes": 112, "NoVotes": 61, "Score": 18, "CurrentStatus": { "Id": 76, "Idea": { "Id": "6cdcf200-3bad-476d-af45-97b52545c337", "ContentId": "b04540ec-eb38-4fa1-b7bb-e3fde05401b4", "ContentTypeId": "44df201a-07e6-42eb-96c7-8ce7ce35aab6", "Challenge": { "Id": "49fec544-6df7-4a82-872b-f8be586d5e9e", "Group": { "Name": "name", "Url": "url", "AvatarUrl": "avatarurl", "Id": 6 }, "ApplicationId": "9f5a6721-639d-4e1d-ab6a-ce63b7750f46", "ApplicationTypeId": "fe65240b-044c-4292-9946-f10e0361ecff", "Name": "name", "Description": "description", "ApplicationKey": "applicationkey", "CreatedDate": "2012-03-29T00:00:00", "IsEnabled": true, "TotalPosts": 25, "LastPostDate": "2012-04-19T00:00:00", "MaximumVotesPerUser": 8, "MaximumVotesPerIdea": 4, "RequiresCategory": true, "AllowMultipleVotes": true }, "Name": "name", "Description": "description", "Status": { "Key": "key", "Name": "name", "Description": "description", "SortOrder": 7, "IsDefault": true, "IsClosed": true, "ReleasesVotes": true, "ScoreValue": 0 }, "StatusNotes": "statusnotes", "StatusAuthorUser": { "DisplayName": "displayname", "Username": "username", "ProfileUrl": "profileurl", "AvatarUrl": "avatarurl", "UserId": 27 }, "StatusDate": "2012-01-16T00:00:00", "AuthorUser": { "DisplayName": "displayname", "Username": "username", "ProfileUrl": "profileurl", "AvatarUrl": "avatarurl", "UserId": 32 }, "CreatedDate": "2012-01-04T00:00:00", "LastUpdatedDate": "2012-05-02T00:00:00", "IsEnabled": true, "Url": "url", "Category": { "IdeationId": "2d525bad-c4df-470d-a193-a1c6d66e5c3e", "Id": 52, "Name": "name" }, "TotalVotes": 19, "YesVotes": 112, "NoVotes": 61, "Score": 18, "CurrentStatus": { "Id": 76, "Idea": { "Id": "bd519379-b61f-4e2f-b0f9-c0f28c5cceb1", "ContentId": "9ba1ec43-dc34-4e27-a579-4a0855144e2f", "ContentTypeId": "e3715662-2528-4ba1-84a7-bfcd9d548f80", "Challenge": null, "Name": "name", "Description": "description", "Status": null, "StatusNotes": "statusnotes", "StatusAuthorUser": null, "StatusDate": null, "AuthorUser": null, "CreatedDate": "2012-06-04T00:00:00", "LastUpdatedDate": "2011-05-28T00:00:00", "IsEnabled": true, "Url": "url", "Category": null, "TotalVotes": 6, "YesVotes": 25, "NoVotes": 8, "Score": 4, "CurrentStatus": null }, "Status": { "Key": "key", "Name": "name", "Description": "description", "SortOrder": 7, "IsDefault": true, "IsClosed": true, "ReleasesVotes": true, "ScoreValue": 0 }, "Author": { "DisplayName": "displayname", "Username": "username", "ProfileUrl": "profileurl", "AvatarUrl": "avatarurl", "UserId": 27 }, "CreatedDate": "2011-12-09T00:00:00", "Note": "note" } }, "Status": { "Key": "key", "Name": "name", "Description": "description", "SortOrder": 32, "IsDefault": true, "IsClosed": true, "ReleasesVotes": true, "ScoreValue": 0 }, "Author": { "DisplayName": "displayname", "Username": "username", "ProfileUrl": "profileurl", "AvatarUrl": "avatarurl", "UserId": 52 }, "CreatedDate": "2012-03-29T00:00:00", "Note": "note" } }, "User": { "DisplayName": "displayname", "Username": "username", "ProfileUrl": "profileurl", "AvatarUrl": "avatarurl", "UserId": 19 }, "Value": true, "TotalVotes": 112 }, "Errors": [ "string", "string" ] }