Leaderboard API docs

Leaderboard API lets you manage teams, scores and leaderboards

Leaderboard API OpenAPI Spec

Get the most up-to-date Open API specification for leaderboard API here: https://api.leaderboardapi.com/swagger

get
Swagger

https://api.leaderboardapi.com/swagger
Get the latest up-t-date open api specification for the leaderboard API.
Request
Response
Request
Path Parameters
optional
string
Response
200: OK
openapi: 3.0.0
info:
title: Leaderboard API
description: A simple leaderboard API that helps manage teams, games and players.
version: 1.0.0
servers:
- url: http://api.example.com/v1
description: Optional server description, e.g. Main (production) server
- url: http://staging-api.example.com
description: Optional server description, e.g. Internal staging server for testing
paths:
/liveness:
get:
description: Returns the readiness of the service
operationId: ping
x-eov-operation-id: ping
x-eov-operation-handler: healthcheck
responses:
"200":
description: OK
content:
application/json:
schema:
properties:
status:
type: string
example: OK
"401":
$ref: "#/components/responses/401"
"404":
$ref: "#/components/responses/404"
"500":
$ref: "#/components/responses/500"

Client credentials

In order to generate valid client credentials, visit https://leaderboardapi.com/dashboard after you've signed up.

Sign up to Leaderboard API here

get
Liveness

https://api.leaderboardapi.com/liveness
Liveness probe endpoint to check if the API is online and live.
Request
Response
Request
Response
200: OK
{ "message": "OK" }
500: Internal Server Error

get
Token

https://api.leaderboardapi.com/token
This endpoint allows you to get an authorization token
Request
Response
Request
Headers
x-client-secret
required
string
Your client secret
x-client-id
required
string
Your client id
Response
200: OK
Successfully generated auth token.
{ authToken: <your_auth_token_jwt> }
401: Unauthorized
Request lacks valid authentication credentials
{ "message": "Invalid Credentials" }

get
Team

https://api.leaderboardapi.com/team/:id
Get a team (by id) or get all teams that belong to your client-id (your client id is generated when you sign up and used to get a valid authorization token).
Request
Response
Request
Path Parameters
id
optional
string
teamId
Headers
Authorization
optional
string
Bearer token
Response
200: OK
{
"teamName": "Greenbay Packers",
"id": "001456732910846354678",
"createdAt": "",
"modifiedAt": ""
}

post
Leaderboard

https://api.leaderboardapi.com/leaderboard
Request
Response
Request
Path Parameters
optional
string
Response
200: OK

post
Team

https://api.leaderboardapi.com/team
Teams belong to leaderboards. You will need to create a leaderboard before creating teams.
Request
Response
Request
Headers
Authorization
required
string
Bearer token JWT
Body Parameters
leaderboardId
required
string
leaderboard id the team belongs to
teamName
required
string
team name
Response
201: Created
{
"teamName": "A Team",
"id": "001456732910846354678",
"createdAt": "",
"modifiedAt": ""
}
401: Unauthorized
{
"message": "Not Authorized"
}

put
Team

/v1/team/:id
Request
Response
Request
Path Parameters
id
required
string
teamId associated with the team being PUT
Headers
Authorization
required
string
Bearer token
Body Parameters
team
required
object
team details you'd like to update
Response
200: OK

delete
Team

/v1/team/:id
Request
Response
Request
Path Parameters
id
required
string
teamId
Headers
Authorization
optional
string
Bearer token
Response
201: Created
no response
401: Unauthorized
{
"message": "Not Authorized"
}

post
Leaderboard

/v1/leaderboard
Create a new leaderboard
Request
Response
Request
Headers
Authorization
required
string
Bearer token
Body Parameters
teams
required
array
teams to add to the leaderboard
Response
201: Created
{
"name": "leaderboard name",
"id": "123789345678",
"createdAt": "",
"modifiedAt": ""
}