Request Parameters
Name | Type | Description | Location | Required | Default | Options |
---|---|---|---|---|---|---|
ParentCommentId | Guid | Parent Comment Id | Query String | Optional | ||
StartCommentId | Guid | Start Comment Id | Query String | Optional | ||
EndCommentId | Guid | End Comment Id | Query String | Optional | ||
ContentId | Guid | Content Id. Either ContentUrl or ContentId and ContentTypeId are required | Query String | Optional | ||
ContentTypeId | Guid | Content Type Id | Query String | Optional | ||
ContentUrl | string | The URL at which the content can be accessed. Either ContentUrl or ContentId and ContentTypeId are required | Query String | Optional | ||
CommentTypeId | Guid | Comment type Id | Query String | Optional | ||
CreatedStartDate | DateTime | Created start date. Only filters first level of comments returned. | Query String | Optional | ||
CreatedEndDate | DateTime | Created end date. Only filters first level of comments returned. | Query String | Optional | ||
ThreadedSortBy | string | Sort threaded comments by. Sort options include CreatedDate, Votes | Query String | Optional | ||
ThreadedSortOrder | string | Sort order of threaded comments returned. 'Ascending' or 'Descending' | Query String | Optional | ||
FlattenedSortBy | string | Sort of flattened comments. Sort options include CreatedDate, Votes | Query String | Optional | ||
FlattenedSortOrder | string | Sort order of flattened comments. 'Ascending' or 'Descending' | Query String | Optional | ||
RootPageSize | int | Number of first level comments to return. Max of 100. | Query String | Optional | 20 | |
FlattenedDepth | int | Specify the depth at which all child comments will be wrapped under the last level of threaded comments. Zero-based index. Max of 9. | Query String | Optional | 2 | |
ChildPageSize | int | Specifies the number of child records to return per first level comment. Max of 50. | Query String | Optional | 10 | |
PostTarget | string | Render target. Options: Unknown, Web, Syndication, Offline, Other, Print, Nntp, Email, WebQuote, WebServices. | Query String | Optional | ||
CommentId | Guid | Comment Id | Query String | Required | ||
ContentId | Guid | Content Id. Either ContentUrl or ContentId and ContentTypeId are required | Query String | Optional | ||
ContentTypeId | Guid | Content Type Id | Query String | Optional | ||
ContentUrl | string | The URL at which the content can be accessed. Either ContentUrl or ContentId and ContentTypeId are required | Query String | Optional | ||
CommentTypeId | Guid | Comment type Id | Query String | Optional | ||
ThreadedSortBy | string | Sort threaded comments by. Sort options include CreatedDate, Votes | Query String | Optional | ||
ThreadedSortOrder | string | Sort order of threaded comments returned. 'Ascending' or 'Descending' | Query String | Optional | ||
FlattenedSortBy | string | Sort of flattened comments. Sort options include CreatedDate, Votes | Query String | Optional | ||
FlattenedSortOrder | string | Sort order of flattened comments. 'Ascending' or 'Descending' | Query String | Optional | ||
FlattenedDepth | int | Specify the depth at which all child comments will be wrapped under the last level of threaded comments. Zero-based index. Max of 9. | Query String | Optional | 2 | |
PageSize | int | Number of comments to return. Max of 100. | Query String | Optional | 20 | |
Direction | string | Specifies the direction paging occurs, either up from the CommentId passed in to the root comment, or down from the root comment for the CommentId passed in. 'FromRootComment', 'FromComment' | Query String | Optional | FromComment | |
PostTarget | string | Render target. Options: Unknown, Web, Syndication, Offline, Other, Print, Nntp, Email, WebQuote, WebServices. | 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, "comments/threaded.json", false, new RestGetOptions { QueryStringParameters = new System.Collections.Specialized.NameValueCollection { { "CommentId", "49fec544-6df7-4a82-872b-f8be586d5e9e" } } });
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/comments/threaded.json', data: { 'CommentId': '49fec544-6df7-4a82-872b-f8be586d5e9e' }, 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/comments/threaded.xml?CommentId=49fec544-6df7-4a82-872b-f8be586d5e9e