config->site['name']; $url = 'http://' . $this->config->site['domain'] . '/api/'; ?>
The API is designed to allow you the easily interact with the leaderboards in your account. We provide all the tools required to push member data to your leaderboards and pull back your members scores and ranks.
module['api_key']) { ?>Before we get started, here’s your API key: module['api_key']; ?>
All API calls start with {version} where {version} corresponds to the version of the API you would like to use.
The current version of the API is v1
You cannot reach the API without including an API key in your request. For the sake of consistency, the API key must be transmitted as part of the query string of URL regardless of the HTTP method being used with the call:
{endpoint}?key={key} where {endpoint} is the call being made and {key} is your API key.
The API only returns a JSON formatted string and utilizes both HTTP status codes as well as a response_code variable in the results. On error, there will also be a error variable that will contain additional information about the error that was encountered.
To help with readability of the returned JSON we offer the pretty parameter which will force the JSON output to be prettified. Simply add &pretty=true after your key to use this parameter.
Returns a list of all of the leaderboards associated with the account. The API equivalent of the My Leaderboards page.
Returns the members with scores sorted in descending order by score. {uid} corresponds with the UID of the leaderboards which can be found on the My Leaderboards page.
Optionally the results can be filtered by member where member is a unique value that maps back to your system. We highly recommend using something that won’t change in the future like an auto incremented field from your database.
Allows you set the score of a member by passing the score parameter. The required score parameter must be an integer.
Allows you to increment the score of a member by 1 point. If the member does not exist, the score will be be set to 1 point. If you would like to increase by more than one or decrement the score you can include the value parameter. The optional value parameter must be an integer.