Request Parameters
Name | Type | Description | Location | Required | Default | Options |
---|---|---|---|---|---|---|
ContainerId | Guid? | Filter by Container to list group level leaderboards. Optional. If ContainerId is set, Scope is ignored and automatically set to 'Container'. | Query String | Optional | ||
Scope | string | Filter by leaderboard location. Optional. Possible values are (All, Global, Container). Ignored if ContainerId is specified. | Query String | Optional | ||
Status | string | Filter by leaderboard active/inactive status. Optional. Possible values are (All, Active, Future, Expired). | Query String | Optional | ||
ContentIds | string | Comma separated list of ContentIds. Used to limit to a specific set of leaderboards as well as sort order if SoryBy is set to ContentIdsOrder. | Query String | Optional | ||
SortOrder | string | Accepted values are: Ascending, Descending | Query String | Optional | ||
SortBy | string | Accepted values are: Name (default), CreatedDate, ContentIdsOrder | 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, "leaderboards.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/leaderboards.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/leaderboards.xml
Example Responses
XML
<?xml version="1.0" encoding="utf-16"?> <Response> <Leaderboards PageSize="2" PageIndex="0" TotalCount="2"> <Leaderboard> <Id>61</Id> <Name>name</Name> <Description>description</Description> <ContentId>49fec544-6df7-4a82-872b-f8be586d5e9e</ContentId> <ContentTypeId>9f5a6721-639d-4e1d-ab6a-ce63b7750f46</ContentTypeId> <CreatedDate>2012-01-04T00:00:00</CreatedDate> <IsEnabled>true</IsEnabled> <NumberOfLeaders>6</NumberOfLeaders> <ContainerId>fe65240b-044c-4292-9946-f10e0361ecff</ContainerId> <StartDate>2012-05-02T00:00:00</StartDate> <EndDate>2012-06-04T00:00:00</EndDate> <StartDisplayDate>2011-05-28T00:00:00</StartDisplayDate> <EndDisplayDate>2011-12-09T00:00:00</EndDisplayDate> <LastCalculatedDate>2012-03-29T00:00:00</LastCalculatedDate> <TimeSpanLength>25</TimeSpanLength> <TimeSpanType>timespantype</TimeSpanType> <TimeSpanFilterType>timespanfiltertype</TimeSpanFilterType> <IncludeRolesFilter> <Role> <Id>8</Id> <Name>name</Name> <Description>description</Description> <GroupId>4</GroupId> <IsSystemRole>true</IsSystemRole> <AvatarUrl>avatarurl</AvatarUrl> <PermissionEntries> <PermissionEntry> <Id>2d525bad-c4df-470d-a193-a1c6d66e5c3e</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> </PermissionEntry> <PermissionEntry> <Id>bd519379-b61f-4e2f-b0f9-c0f28c5cceb1</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> </PermissionEntry> </PermissionEntries> </Role> <Role> <Id>7</Id> <Name>name</Name> <Description>description</Description> <GroupId>27</GroupId> <IsSystemRole>true</IsSystemRole> <AvatarUrl>avatarurl</AvatarUrl> <PermissionEntries> <PermissionEntry> <Id>9ba1ec43-dc34-4e27-a579-4a0855144e2f</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> </PermissionEntry> <PermissionEntry> <Id>e3715662-2528-4ba1-84a7-bfcd9d548f80</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> </PermissionEntry> </PermissionEntries> </Role> </IncludeRolesFilter> <ExcludeRolesFilter> <Role> <Id>32</Id> <Name>name</Name> <Description>description</Description> <GroupId>52</GroupId> <IsSystemRole>true</IsSystemRole> <AvatarUrl>avatarurl</AvatarUrl> <PermissionEntries> <PermissionEntry> <Id>6cdcf200-3bad-476d-af45-97b52545c337</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> </PermissionEntry> <PermissionEntry> <Id>b04540ec-eb38-4fa1-b7bb-e3fde05401b4</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> </PermissionEntry> </PermissionEntries> </Role> <Role> <Id>19</Id> <Name>name</Name> <Description>description</Description> <GroupId>112</GroupId> <IsSystemRole>true</IsSystemRole> <AvatarUrl>avatarurl</AvatarUrl> <PermissionEntries> <PermissionEntry> <Id>44df201a-07e6-42eb-96c7-8ce7ce35aab6</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> </PermissionEntry> <PermissionEntry> <Id>49fec544-6df7-4a82-872b-f8be586d5e9e</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> </PermissionEntry> </PermissionEntries> </Role> </ExcludeRolesFilter> <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> <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> </Application> </Leaderboard> <Leaderboard> <Id>19</Id> <Name>name</Name> <Description>description</Description> <ContentId>9ba1ec43-dc34-4e27-a579-4a0855144e2f</ContentId> <ContentTypeId>e3715662-2528-4ba1-84a7-bfcd9d548f80</ContentTypeId> <CreatedDate>2012-04-19T00:00:00</CreatedDate> <IsEnabled>true</IsEnabled> <NumberOfLeaders>18</NumberOfLeaders> <ContainerId>6cdcf200-3bad-476d-af45-97b52545c337</ContainerId> <StartDate>2012-01-16T00:00:00</StartDate> <EndDate>2012-01-04T00:00:00</EndDate> <StartDisplayDate>2012-05-02T00:00:00</StartDisplayDate> <EndDisplayDate>2012-06-04T00:00:00</EndDisplayDate> <LastCalculatedDate>2011-05-28T00:00:00</LastCalculatedDate> <TimeSpanLength>76</TimeSpanLength> <TimeSpanType>timespantype</TimeSpanType> <TimeSpanFilterType>timespanfiltertype</TimeSpanFilterType> <IncludeRolesFilter> <Role> <Id>6</Id> <Name>name</Name> <Description>description</Description> <GroupId>25</GroupId> <IsSystemRole>true</IsSystemRole> <AvatarUrl>avatarurl</AvatarUrl> <PermissionEntries> <PermissionEntry> <Id>b04540ec-eb38-4fa1-b7bb-e3fde05401b4</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> </PermissionEntry> <PermissionEntry> <Id>44df201a-07e6-42eb-96c7-8ce7ce35aab6</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> </PermissionEntry> </PermissionEntries> </Role> <Role> <Id>8</Id> <Name>name</Name> <Description>description</Description> <GroupId>4</GroupId> <IsSystemRole>true</IsSystemRole> <AvatarUrl>avatarurl</AvatarUrl> <PermissionEntries> <PermissionEntry> <Id>49fec544-6df7-4a82-872b-f8be586d5e9e</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> </PermissionEntry> <PermissionEntry> <Id>9f5a6721-639d-4e1d-ab6a-ce63b7750f46</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> </PermissionEntry> </PermissionEntries> </Role> </IncludeRolesFilter> <ExcludeRolesFilter> <Role> <Id>7</Id> <Name>name</Name> <Description>description</Description> <GroupId>27</GroupId> <IsSystemRole>true</IsSystemRole> <AvatarUrl>avatarurl</AvatarUrl> <PermissionEntries> <PermissionEntry> <Id>fe65240b-044c-4292-9946-f10e0361ecff</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> </PermissionEntry> <PermissionEntry> <Id>2d525bad-c4df-470d-a193-a1c6d66e5c3e</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> </PermissionEntry> </PermissionEntries> </Role> <Role> <Id>32</Id> <Name>name</Name> <Description>description</Description> <GroupId>52</GroupId> <IsSystemRole>true</IsSystemRole> <AvatarUrl>avatarurl</AvatarUrl> <PermissionEntries> <PermissionEntry> <Id>bd519379-b61f-4e2f-b0f9-c0f28c5cceb1</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> </PermissionEntry> <PermissionEntry> <Id>9ba1ec43-dc34-4e27-a579-4a0855144e2f</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> </PermissionEntry> </PermissionEntries> </Role> </ExcludeRolesFilter> <Application> <ApplicationId>e3715662-2528-4ba1-84a7-bfcd9d548f80</ApplicationId> <ApplicationTypeId>6cdcf200-3bad-476d-af45-97b52545c337</ApplicationTypeId> <HtmlName>htmlname</HtmlName> <HtmlDescription>htmldescription</HtmlDescription> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> <Container> <ContainerId>b04540ec-eb38-4fa1-b7bb-e3fde05401b4</ContainerId> <ContainerTypeId>44df201a-07e6-42eb-96c7-8ce7ce35aab6</ContainerTypeId> <HtmlName>htmlname</HtmlName> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> </Container> </Application> </Leaderboard> </Leaderboards> <Errors> <Message>string</Message> <Message>string</Message> </Errors> </Response>
JSON
{ "PageSize": 2, "PageIndex": 0, "TotalCount": 2, "Leaderboards": [ { "Name": "name", "Description": "description", "ContentId": "49fec544-6df7-4a82-872b-f8be586d5e9e", "ContentTypeId": "9f5a6721-639d-4e1d-ab6a-ce63b7750f46", "CreatedDate": "2012-01-04T00:00:00", "IsEnabled": true, "NumberOfLeaders": 6, "ContainerId": "fe65240b-044c-4292-9946-f10e0361ecff", "StartDate": "2012-05-02T00:00:00", "EndDate": "2012-06-04T00:00:00", "StartDisplayDate": "2011-05-28T00:00:00", "EndDisplayDate": "2011-12-09T00:00:00", "LastCalculatedDate": "2012-03-29T00:00:00", "TimeSpanLength": 25, "TimeSpanType": "timespantype", "TimeSpanFilterType": "timespanfiltertype", "IncludeRolesFilter": [ { "Id": 8, "Name": "name", "Description": "description", "GroupId": 4, "IsSystemRole": true, "ImageUrl": "", "AvatarUrl": "avatarurl", "PermissionEntries": [ { "Id": "2d525bad-c4df-470d-a193-a1c6d66e5c3e", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true }, { "Id": "bd519379-b61f-4e2f-b0f9-c0f28c5cceb1", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true } ] }, { "Id": 7, "Name": "name", "Description": "description", "GroupId": 27, "IsSystemRole": true, "ImageUrl": "", "AvatarUrl": "avatarurl", "PermissionEntries": [ { "Id": "9ba1ec43-dc34-4e27-a579-4a0855144e2f", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true }, { "Id": "e3715662-2528-4ba1-84a7-bfcd9d548f80", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true } ] } ], "ExcludeRolesFilter": [ { "Id": 32, "Name": "name", "Description": "description", "GroupId": 52, "IsSystemRole": true, "ImageUrl": "", "AvatarUrl": "avatarurl", "PermissionEntries": [ { "Id": "6cdcf200-3bad-476d-af45-97b52545c337", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true }, { "Id": "b04540ec-eb38-4fa1-b7bb-e3fde05401b4", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true } ] }, { "Id": 19, "Name": "name", "Description": "description", "GroupId": 112, "IsSystemRole": true, "ImageUrl": "", "AvatarUrl": "avatarurl", "PermissionEntries": [ { "Id": "44df201a-07e6-42eb-96c7-8ce7ce35aab6", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true }, { "Id": "49fec544-6df7-4a82-872b-f8be586d5e9e", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true } ] } ], "Application": { "ApplicationId": "9f5a6721-639d-4e1d-ab6a-ce63b7750f46", "ApplicationTypeId": "fe65240b-044c-4292-9946-f10e0361ecff", "HtmlName": "htmlname", "HtmlDescription": "htmldescription", "Url": "url", "AvatarUrl": "avatarurl", "Container": { "ContainerId": "2d525bad-c4df-470d-a193-a1c6d66e5c3e", "ContainerTypeId": "bd519379-b61f-4e2f-b0f9-c0f28c5cceb1", "HtmlName": "htmlname", "Url": "url", "AvatarUrl": "avatarurl" } }, "Id": 61 }, { "Name": "name", "Description": "description", "ContentId": "9ba1ec43-dc34-4e27-a579-4a0855144e2f", "ContentTypeId": "e3715662-2528-4ba1-84a7-bfcd9d548f80", "CreatedDate": "2012-04-19T00:00:00", "IsEnabled": true, "NumberOfLeaders": 18, "ContainerId": "6cdcf200-3bad-476d-af45-97b52545c337", "StartDate": "2012-01-16T00:00:00", "EndDate": "2012-01-04T00:00:00", "StartDisplayDate": "2012-05-02T00:00:00", "EndDisplayDate": "2012-06-04T00:00:00", "LastCalculatedDate": "2011-05-28T00:00:00", "TimeSpanLength": 76, "TimeSpanType": "timespantype", "TimeSpanFilterType": "timespanfiltertype", "IncludeRolesFilter": [ { "Id": 6, "Name": "name", "Description": "description", "GroupId": 25, "IsSystemRole": true, "ImageUrl": "", "AvatarUrl": "avatarurl", "PermissionEntries": [ { "Id": "b04540ec-eb38-4fa1-b7bb-e3fde05401b4", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true }, { "Id": "44df201a-07e6-42eb-96c7-8ce7ce35aab6", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true } ] }, { "Id": 8, "Name": "name", "Description": "description", "GroupId": 4, "IsSystemRole": true, "ImageUrl": "", "AvatarUrl": "avatarurl", "PermissionEntries": [ { "Id": "49fec544-6df7-4a82-872b-f8be586d5e9e", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true }, { "Id": "9f5a6721-639d-4e1d-ab6a-ce63b7750f46", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true } ] } ], "ExcludeRolesFilter": [ { "Id": 7, "Name": "name", "Description": "description", "GroupId": 27, "IsSystemRole": true, "ImageUrl": "", "AvatarUrl": "avatarurl", "PermissionEntries": [ { "Id": "fe65240b-044c-4292-9946-f10e0361ecff", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true }, { "Id": "2d525bad-c4df-470d-a193-a1c6d66e5c3e", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true } ] }, { "Id": 32, "Name": "name", "Description": "description", "GroupId": 52, "IsSystemRole": true, "ImageUrl": "", "AvatarUrl": "avatarurl", "PermissionEntries": [ { "Id": "bd519379-b61f-4e2f-b0f9-c0f28c5cceb1", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true }, { "Id": "9ba1ec43-dc34-4e27-a579-4a0855144e2f", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true } ] } ], "Application": { "ApplicationId": "e3715662-2528-4ba1-84a7-bfcd9d548f80", "ApplicationTypeId": "6cdcf200-3bad-476d-af45-97b52545c337", "HtmlName": "htmlname", "HtmlDescription": "htmldescription", "Url": "url", "AvatarUrl": "avatarurl", "Container": { "ContainerId": "b04540ec-eb38-4fa1-b7bb-e3fde05401b4", "ContainerTypeId": "44df201a-07e6-42eb-96c7-8ce7ce35aab6", "HtmlName": "htmlname", "Url": "url", "AvatarUrl": "avatarurl" } }, "Id": 19 } ], "Errors": [ "string", "string" ] }