Request Parameters
Name | Type | Description | Location | Required | Default | Options |
---|---|---|---|---|---|---|
ApplicationId | Guid | Content application identifier for the liked item. | Query String | Optional | ||
ContainerId | Guid | Content container identifier for the liked item. | Query String | Optional | ||
IncludeSubContainers | bool | Include sub containers when filtering by ContentId | Query String | Optional | ||
ContentTypeId | Guid | Content type identifier for the liked item. | Query String | Optional | ||
ContentTypeIds | string | Comma separated list of Content type ids. Used to filter likes by specific content types. | Query String | Optional | ||
ContentIds | string | Comma separated list of ContentIds. Used to limit to a specific set of liked items as well as sort order if SoryBy is set to ContentIdsOrder. | Query String | Optional | ||
PageSize | int | Number of results to return | Query String | Optional | ||
PageIndex | int | Page of results to return | Query String | Optional | ||
SortBy | string | Accepted values are: LikeCount (default), ContentIdsOrder | Query String | Optional | LikeCount | |
SortOrder | string | Accepted values are: Ascending, Descending | Query String | Optional | ||
TypeId | Guid | Categorization type for the like. | Query String | Optional | ||
ContentCreatedAfterDate | Guid | Include only content created on or after. | Query String | Optional | ||
ContentCreatedBeforeDate | Guid | Include only content created before. | Query String | Optional | ||
AuthorId | int | Author Id of the content that was liked. | Query String | Optional | ||
MinimumLikeCount | int | Minimum number of likes the content must have for content to be returned | Query String | Optional | ||
MaximumLikeCount | int | MaximumLikeCount number of likes the content can have for content to be returned | Query String | Optional |
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, "likeditems.json", false);
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/likeditems.json', 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/likeditems.xml
Example Responses
XML
<?xml version="1.0" encoding="utf-16"?> <Response> <LikedItems PageSize="2" PageIndex="0" TotalCount="2"> <LikedItem> <TypeId>49fec544-6df7-4a82-872b-f8be586d5e9e</TypeId> <LikeCount>6</LikeCount> </LikedItem> <LikedItem> <TypeId>9f5a6721-639d-4e1d-ab6a-ce63b7750f46</TypeId> <LikeCount>25</LikeCount> </LikedItem> </LikedItems> <Errors> <Message>string</Message> <Message>string</Message> </Errors> </Response>
JSON
{ "PageSize": 2, "PageIndex": 0, "TotalCount": 2, "LikedItems": [ { "Content": null, "TypeId": "49fec544-6df7-4a82-872b-f8be586d5e9e", "LikeCount": 6, "Warnings": [], "Errors": [] }, { "Content": null, "TypeId": "9f5a6721-639d-4e1d-ab6a-ce63b7750f46", "LikeCount": 25, "Warnings": [], "Errors": [] } ], "Errors": [ "string", "string" ] }