Request Parameters
Name | Type | Description | Location | Required | Default | Options |
---|---|---|---|---|---|---|
Query | string | Full text of query | Query String | Optional | ||
SortBy | string | Accepted values are: date asc, score asc, date desc, score desc | Query String | Optional | ||
PageSize | int | Number of results to return | Query String | Optional | ||
PageIndex | int | Page of results to return | 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, "conversationmessages/search.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/conversationmessages/search.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/conversationmessages/search.xml
Example Responses
XML
<?xml version="1.0" encoding="utf-16"?> <Response> <ConversationMessages PageSize="2" PageIndex="0" TotalCount="2"> <Achievement> <Id>49fec544-6df7-4a82-872b-f8be586d5e9e</Id> <Title>title</Title> <Criteria>criteria</Criteria> <BadgeIconUrl>badgeiconurl</BadgeIconUrl> <Enabled>true</Enabled> <CreatedDate>2012-01-04T00:00:00</CreatedDate> <AutomationId>9f5a6721-639d-4e1d-ab6a-ce63b7750f46</AutomationId> </Achievement> <Achievement> <Id>fe65240b-044c-4292-9946-f10e0361ecff</Id> <Title>title</Title> <Criteria>criteria</Criteria> <BadgeIconUrl>badgeiconurl</BadgeIconUrl> <Enabled>true</Enabled> <CreatedDate>2012-05-02T00:00:00</CreatedDate> <AutomationId>2d525bad-c4df-470d-a193-a1c6d66e5c3e</AutomationId> </Achievement> </ConversationMessages> <Errors> <Message>string</Message> <Message>string</Message> </Errors> </Response>
JSON
{ "PageSize": 2, "PageIndex": 0, "TotalCount": 2, "ConversationMessages": [ { "Id": "49fec544-6df7-4a82-872b-f8be586d5e9e", "Title": "title", "Criteria": "criteria", "BadgeIconUrl": "badgeiconurl", "Enabled": true, "CreatedDate": "2012-01-04T00:00:00", "AutomationId": "9f5a6721-639d-4e1d-ab6a-ce63b7750f46", "AutomationConfiguration": {}, "ContentId": "49fec544-6df7-4a82-872b-f8be586d5e9e", "Url": "/achievements/49fec544-6df7-4a82-872b-f8be586d5e9e", "Application": { "Id": 1, "DateCreated": "2018-09-27T21:12:21.52", "Description": "", "Key": "root", "Name": "Telligent Community", "ParentGroupId": -1, "Url": "http://trunk.community.local.telligent.com/", "GroupType": "Joinless", "EnableGroupMessages": true, "EnableContact": false, "TotalMembers": 0, "HasGroups": true, "PendingMembers": 0, "AvatarUrl": "/cfs-file/__key/communityserver-wikis-components-files/00-00-00-12-82/4162.defaulthub.gif", "GroupCount": 1, "ThemeId": "3fc3f824-83d1-4ec4-85ef-92e206116d49", "ApplicationId": "874c3878-ef28-47c5-92c3-23e97ef8b66a", "ContainerId": "874c3878-ef28-47c5-92c3-23e97ef8b66a", "ExtendedAttributes": [], "Warnings": [], "Errors": [] }, "Warnings": [], "Errors": [] }, { "Id": "fe65240b-044c-4292-9946-f10e0361ecff", "Title": "title", "Criteria": "criteria", "BadgeIconUrl": "badgeiconurl", "Enabled": true, "CreatedDate": "2012-05-02T00:00:00", "AutomationId": "2d525bad-c4df-470d-a193-a1c6d66e5c3e", "AutomationConfiguration": {}, "ContentId": "fe65240b-044c-4292-9946-f10e0361ecff", "Url": "/achievements/fe65240b-044c-4292-9946-f10e0361ecff", "Application": { "Id": 1, "DateCreated": "2018-09-27T21:12:21.52", "Description": "", "Key": "root", "Name": "Telligent Community", "ParentGroupId": -1, "Url": "http://trunk.community.local.telligent.com/", "GroupType": "Joinless", "EnableGroupMessages": true, "EnableContact": false, "TotalMembers": 0, "HasGroups": true, "PendingMembers": 0, "AvatarUrl": "/cfs-file/__key/communityserver-wikis-components-files/00-00-00-12-82/4162.defaulthub.gif", "GroupCount": 1, "ThemeId": "3fc3f824-83d1-4ec4-85ef-92e206116d49", "ApplicationId": "874c3878-ef28-47c5-92c3-23e97ef8b66a", "ContainerId": "874c3878-ef28-47c5-92c3-23e97ef8b66a", "ExtendedAttributes": [], "Warnings": [], "Errors": [] }, "Warnings": [], "Errors": [] } ], "Errors": [ "string", "string" ] }