config->site['name']; $url = 'http://' . $this->config->site['domain'] . '/api/'; ?>

REST API v1.0

Introduction

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']; ?>

URL Prefix

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

Authentication

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.

Endpoints

/leaderboards

GET

Returns a list of all of the leaderboards associated with the account. The API equivalent of the My Leaderboards page.

/leaderboard/{uid}

GET

Returns the members, scores and ranks 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.

POST

Allows you set the score of a member by passing the score parameter. The required score parameter must be an integer.

PUT

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.