Request Parameters
Name | Type | Description | Location | Required | Default | Options |
---|---|---|---|---|---|---|
Id | Guid | Id of the Leaderboard | Query String | Required | ||
PageSize | int | Number of results to return | Query String | Optional | ||
PageIndex | int | Page of results to return | Query String | Optional | ||
SortOrder | int | Ascending or Descending (by rank) | 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, "leaderboards/{leaderboardId}/leaders.json", false, new RestGetOptions { QueryStringParameters = new System.Collections.Specialized.NameValueCollection { { "Id", "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/leaderboards/{leaderboardId}/leaders.json', data: { 'Id': '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/leaderboards/{leaderboardId}/leaders.xml?Id=49fec544-6df7-4a82-872b-f8be586d5e9e
Example Responses
XML
<?xml version="1.0" encoding="utf-16"?> <Response> <Leaders PageSize="2" PageIndex="0" TotalCount="2"> <Leader> <Id>18</Id> <User> <Id>52</Id> <AvatarUrl>avatarurl</AvatarUrl> <DisplayName>displayname</DisplayName> <ProfileUrl>profileurl</ProfileUrl> <Username>username</Username> <CurrentStatus> <Id>9f5a6721-639d-4e1d-ab6a-ce63b7750f46</Id> <Author> <Id>25</Id> <AvatarUrl>avatarurl</AvatarUrl> <DisplayName>displayname</DisplayName> <ProfileUrl>profileurl</ProfileUrl> <Username>username</Username> <CurrentStatus> <Id>49fec544-6df7-4a82-872b-f8be586d5e9e</Id> <Body>body</Body> <CreatedDate /> <ReplyCount>6</ReplyCount> <AttachedUrl>attachedurl</AttachedUrl> <ContentId>49fec544-6df7-4a82-872b-f8be586d5e9e</ContentId> <ContentType>56f1a3ec-14bb-45c6-949f-ee7776d68c78</ContentType> <Url>url</Url> <IsPublished>true</IsPublished> </CurrentStatus> </Author> <Body>body</Body> <CreatedDate>2012-01-04T00:00:00</CreatedDate> <ReplyCount>8</ReplyCount> <Group> <Id>32</Id> <AvatarUrl>avatarurl</AvatarUrl> <DateCreated>2012-05-02T00:00:00</DateCreated> <Description>description</Description> <Key>key</Key> <Name>name</Name> <ParentGroupId>4</ParentGroupId> <Url>url</Url> <TotalMembers>7</TotalMembers> <HasGroups>true</HasGroups> <GroupCount>27</GroupCount> <GroupType>grouptype</GroupType> <EnableGroupMessages>true</EnableGroupMessages> <EnableContact>true</EnableContact> <SearchUniqueId>searchuniqueid</SearchUniqueId> <ExtendedAttributes /> <ContainerId>fe65240b-044c-4292-9946-f10e0361ecff</ContainerId> <Container> <ContainerId>2d525bad-c4df-470d-a193-a1c6d66e5c3e</ContainerId> <ContainerTypeId>bd519379-b61f-4e2f-b0f9-c0f28c5cceb1</ContainerTypeId> <HtmlName>htmlname</HtmlName> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> </Container> </Group> <AttachedUrl>attachedurl</AttachedUrl> <ContentId>9f5a6721-639d-4e1d-ab6a-ce63b7750f46</ContentId> <ContentType>56f1a3ec-14bb-45c6-949f-ee7776d68c78</ContentType> <Url>url</Url> <IsPublished>true</IsPublished> <Content> <CreatedByUser> <Id /> <AvatarUrl>avatarurl</AvatarUrl> <DisplayName>displayname</DisplayName> <ProfileUrl>profileurl</ProfileUrl> <Username>username</Username> </CreatedByUser> <ContentId>6cdcf200-3bad-476d-af45-97b52545c337</ContentId> <ContentTypeId>b04540ec-eb38-4fa1-b7bb-e3fde05401b4</ContentTypeId> <CreatedDate>2012-06-04T00:00:00</CreatedDate> <HtmlName>htmlname</HtmlName> <HtmlDescription>htmldescription</HtmlDescription> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> <Application> <ApplicationId>44df201a-07e6-42eb-96c7-8ce7ce35aab6</ApplicationId> <ApplicationTypeId>49fec544-6df7-4a82-872b-f8be586d5e9e</ApplicationTypeId> <HtmlName>htmlname</HtmlName> <HtmlDescription>htmldescription</HtmlDescription> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> </Application> </Content> </CurrentStatus> </User> <LeaderboardId>19</LeaderboardId> <Rank>112</Rank> <Value>61</Value> </Leader> <Leader> <Id>61</Id> <User> <Id>32</Id> <AvatarUrl>avatarurl</AvatarUrl> <DisplayName>displayname</DisplayName> <ProfileUrl>profileurl</ProfileUrl> <Username>username</Username> <CurrentStatus> <Id>2d525bad-c4df-470d-a193-a1c6d66e5c3e</Id> <Author> <Id>6</Id> <AvatarUrl>avatarurl</AvatarUrl> <DisplayName>displayname</DisplayName> <ProfileUrl>profileurl</ProfileUrl> <Username>username</Username> <CurrentStatus> <Id>fe65240b-044c-4292-9946-f10e0361ecff</Id> <Body>body</Body> <CreatedDate /> <ReplyCount>76</ReplyCount> <AttachedUrl>attachedurl</AttachedUrl> <ContentId>fe65240b-044c-4292-9946-f10e0361ecff</ContentId> <ContentType>56f1a3ec-14bb-45c6-949f-ee7776d68c78</ContentType> <Url>url</Url> <IsPublished>true</IsPublished> </CurrentStatus> </Author> <Body>body</Body> <CreatedDate>2011-05-28T00:00:00</CreatedDate> <ReplyCount>25</ReplyCount> <Group> <Id>27</Id> <AvatarUrl>avatarurl</AvatarUrl> <DateCreated>2011-12-09T00:00:00</DateCreated> <Description>description</Description> <Key>key</Key> <Name>name</Name> <ParentGroupId>8</ParentGroupId> <Url>url</Url> <TotalMembers>4</TotalMembers> <HasGroups>true</HasGroups> <GroupCount>7</GroupCount> <GroupType>grouptype</GroupType> <EnableGroupMessages>true</EnableGroupMessages> <EnableContact>true</EnableContact> <SearchUniqueId>searchuniqueid</SearchUniqueId> <ExtendedAttributes /> <ContainerId>bd519379-b61f-4e2f-b0f9-c0f28c5cceb1</ContainerId> <Container> <ContainerId>9ba1ec43-dc34-4e27-a579-4a0855144e2f</ContainerId> <ContainerTypeId>e3715662-2528-4ba1-84a7-bfcd9d548f80</ContainerTypeId> <HtmlName>htmlname</HtmlName> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> </Container> </Group> <AttachedUrl>attachedurl</AttachedUrl> <ContentId>2d525bad-c4df-470d-a193-a1c6d66e5c3e</ContentId> <ContentType>56f1a3ec-14bb-45c6-949f-ee7776d68c78</ContentType> <Url>url</Url> <IsPublished>true</IsPublished> <Content> <CreatedByUser> <Id /> <AvatarUrl>avatarurl</AvatarUrl> <DisplayName>displayname</DisplayName> <ProfileUrl>profileurl</ProfileUrl> <Username>username</Username> </CreatedByUser> <ContentId>44df201a-07e6-42eb-96c7-8ce7ce35aab6</ContentId> <ContentTypeId>49fec544-6df7-4a82-872b-f8be586d5e9e</ContentTypeId> <CreatedDate>2012-03-29T00:00:00</CreatedDate> <HtmlName>htmlname</HtmlName> <HtmlDescription>htmldescription</HtmlDescription> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> <Application> <ApplicationId>9f5a6721-639d-4e1d-ab6a-ce63b7750f46</ApplicationId> <ApplicationTypeId>fe65240b-044c-4292-9946-f10e0361ecff</ApplicationTypeId> <HtmlName>htmlname</HtmlName> <HtmlDescription>htmldescription</HtmlDescription> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> </Application> </Content> </CurrentStatus> </User> <LeaderboardId>52</LeaderboardId> <Rank>19</Rank> <Value>112</Value> </Leader> </Leaders> <Errors> <Message>string</Message> <Message>string</Message> </Errors> </Response>
JSON
{ "PageSize": 2, "PageIndex": 0, "TotalCount": 2, "Leaders": [ { "User": { "AvatarUrl": "avatarurl", "DisplayName": "displayname", "ProfileUrl": "profileurl", "Username": "username", "CurrentStatus": { "Author": { "AvatarUrl": "avatarurl", "DisplayName": "displayname", "ProfileUrl": "profileurl", "Username": "username", "CurrentStatus": { "Author": null, "Body": "body", "CreatedDate": null, "ReplyCount": 6, "Group": null, "AttachedUrl": "attachedurl", "HasReplies": null, "ContentId": "49fec544-6df7-4a82-872b-f8be586d5e9e", "ContentType": "56f1a3ec-14bb-45c6-949f-ee7776d68c78", "Url": "url", "IsPublished": true, "Content": null, "Id": "49fec544-6df7-4a82-872b-f8be586d5e9e" }, "Id": 25 }, "Body": "body", "CreatedDate": "2012-01-04T00:00:00", "ReplyCount": 8, "Group": { "AvatarUrl": "avatarurl", "DateCreated": "2012-05-02T00:00:00", "Description": "description", "Key": "key", "Name": "name", "ParentGroupId": 4, "Url": "url", "TotalMembers": 7, "HasGroups": true, "GroupCount": 27, "GroupType": "grouptype", "EnableGroupMessages": true, "EnableContact": true, "SearchUniqueId": "searchuniqueid", "IsEnabled": true, "ExtendedAttributes": [], "ContainerId": "fe65240b-044c-4292-9946-f10e0361ecff", "ContainerTypeId": "23b05a61-c3e5-4451-90d9-bfa00453bce4", "Container": { "ContainerId": "2d525bad-c4df-470d-a193-a1c6d66e5c3e", "ContainerTypeId": "bd519379-b61f-4e2f-b0f9-c0f28c5cceb1", "HtmlName": "htmlname", "Url": "url", "AvatarUrl": "avatarurl" }, "Id": 32 }, "AttachedUrl": "attachedurl", "HasReplies": true, "ContentId": "9f5a6721-639d-4e1d-ab6a-ce63b7750f46", "ContentType": "56f1a3ec-14bb-45c6-949f-ee7776d68c78", "Url": "url", "IsPublished": true, "Content": { "CreatedByUser": { "AvatarUrl": "avatarurl", "DisplayName": "displayname", "ProfileUrl": "profileurl", "Username": "username", "CurrentStatus": null, "Id": null }, "ContentId": "6cdcf200-3bad-476d-af45-97b52545c337", "ContentTypeId": "b04540ec-eb38-4fa1-b7bb-e3fde05401b4", "CreatedDate": "2012-06-04T00:00:00", "HtmlName": "htmlname", "HtmlDescription": "htmldescription", "Url": "url", "AvatarUrl": "avatarurl", "Application": { "ApplicationId": "44df201a-07e6-42eb-96c7-8ce7ce35aab6", "ApplicationTypeId": "49fec544-6df7-4a82-872b-f8be586d5e9e", "HtmlName": "htmlname", "HtmlDescription": "htmldescription", "Url": "url", "AvatarUrl": "avatarurl", "Container": null } }, "Id": "9f5a6721-639d-4e1d-ab6a-ce63b7750f46" }, "Id": 52 }, "LeaderboardId": 19, "Rank": 112, "Value": 61, "Id": 18 }, { "User": { "AvatarUrl": "avatarurl", "DisplayName": "displayname", "ProfileUrl": "profileurl", "Username": "username", "CurrentStatus": { "Author": { "AvatarUrl": "avatarurl", "DisplayName": "displayname", "ProfileUrl": "profileurl", "Username": "username", "CurrentStatus": { "Author": null, "Body": "body", "CreatedDate": null, "ReplyCount": 76, "Group": null, "AttachedUrl": "attachedurl", "HasReplies": null, "ContentId": "fe65240b-044c-4292-9946-f10e0361ecff", "ContentType": "56f1a3ec-14bb-45c6-949f-ee7776d68c78", "Url": "url", "IsPublished": true, "Content": null, "Id": "fe65240b-044c-4292-9946-f10e0361ecff" }, "Id": 6 }, "Body": "body", "CreatedDate": "2011-05-28T00:00:00", "ReplyCount": 25, "Group": { "AvatarUrl": "avatarurl", "DateCreated": "2011-12-09T00:00:00", "Description": "description", "Key": "key", "Name": "name", "ParentGroupId": 8, "Url": "url", "TotalMembers": 4, "HasGroups": true, "GroupCount": 7, "GroupType": "grouptype", "EnableGroupMessages": true, "EnableContact": true, "SearchUniqueId": "searchuniqueid", "IsEnabled": true, "ExtendedAttributes": [], "ContainerId": "bd519379-b61f-4e2f-b0f9-c0f28c5cceb1", "ContainerTypeId": "23b05a61-c3e5-4451-90d9-bfa00453bce4", "Container": { "ContainerId": "9ba1ec43-dc34-4e27-a579-4a0855144e2f", "ContainerTypeId": "e3715662-2528-4ba1-84a7-bfcd9d548f80", "HtmlName": "htmlname", "Url": "url", "AvatarUrl": "avatarurl" }, "Id": 27 }, "AttachedUrl": "attachedurl", "HasReplies": true, "ContentId": "2d525bad-c4df-470d-a193-a1c6d66e5c3e", "ContentType": "56f1a3ec-14bb-45c6-949f-ee7776d68c78", "Url": "url", "IsPublished": true, "Content": { "CreatedByUser": { "AvatarUrl": "avatarurl", "DisplayName": "displayname", "ProfileUrl": "profileurl", "Username": "username", "CurrentStatus": null, "Id": null }, "ContentId": "44df201a-07e6-42eb-96c7-8ce7ce35aab6", "ContentTypeId": "49fec544-6df7-4a82-872b-f8be586d5e9e", "CreatedDate": "2012-03-29T00:00:00", "HtmlName": "htmlname", "HtmlDescription": "htmldescription", "Url": "url", "AvatarUrl": "avatarurl", "Application": { "ApplicationId": "9f5a6721-639d-4e1d-ab6a-ce63b7750f46", "ApplicationTypeId": "fe65240b-044c-4292-9946-f10e0361ecff", "HtmlName": "htmlname", "HtmlDescription": "htmldescription", "Url": "url", "AvatarUrl": "avatarurl", "Container": null } }, "Id": "2d525bad-c4df-470d-a193-a1c6d66e5c3e" }, "Id": 32 }, "LeaderboardId": 52, "Rank": 19, "Value": 112, "Id": 61 } ], "Errors": [ "string", "string" ] }