To use ezLadder, you must first create an account
Add a game
Adding a game simply requires a name.
2 keys are then generated :
game_key : Key used to identify your game at each call to the API
secret_key : Key to secure calls to the API
secret_key must always remain secret and must not appear anywhere in the clear !
Leaderboards
A game can have multiple leaderboards. When adding a game a leaderboard named "General" is created.
Each leaderboard is identified by a key named leaderboard_key.
API
API is available at https://api.ezladder.net.
Note that the use of https is required.
Dates and times
All dates and times sent to ezladder must use the UTC time zone.
Requests
Each request must contain the following headers :
game-key : game_key of the game affected by the request. Watch out for the dash "-" instead of "_" (game-key and not game_key).
timestamp : Timestamp of the request (UTC)
signature : An HMAC signature generated from the callled API URL, the timestamp and the secret_key, using the hash algorithm SHA256
Generate the signature
For example, we want to call http://api.ezladder.net/players
  • We add the timestamp to the URL of the request, in order to obtain a fictional URL that will serve as a basis for generating the signature. We obtain for example players/1563975789
  • The signature is then generated by calculating an HMAC from the fictional URL and the game's secret_key, using SHA256.
Example (PHP) :
$tmpURL = "players/".gmmktime();
$signature = hash_hmac("sha256", $tmpURL, "secret_key");
Add a playerPOST /players
Sending a score for a player requires that it has been created before.
The method to do this is POST /players.
If the player's creation is successful, the API returns the player's player_key, which will be used for all calls to the API concerning that player. It accepts 5 parameters:
name required string Player's nickname. Max 191 characters.
player_key optional string (max 191 characters) Player's player_key if you do not want it to be generated by ezLadder (for example in the case where your game already assigns a unique login to each player). The player_key is not editable.
avatar optional string Player's avatar. Max 191 characters.
info optional string A string of up to 2000 characters you can use at your convenience (stats, avatar, JSON...), you must not store personal information about players in (such as real name, address...)
email optional string (email) Player's eamil, to create an account so that the player can retrieve his scores if he connects from another device or if he reinstalls the game
password required if email is present string (min 8 chars) Account password
Example (JS) :
fetch('https://api.ezladder.net/players', {
  method: 'POST',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json', 
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  },
  body: JSON.stringify({  
    "name":"Player 1"
  })
}); 
Update a playerPATCH /players/{player_key}
Call the PATCH /players/{player_key} method to update a player. It accepts 3 parameters :
name optional string New player's nickname. Max 191 characters.
avatar optional string New player's avatar. Max 191 characters.
info optional string A string of up to 2000 characters you can use at your convenience (stats, avatar, JSON...), you must not store personal information about players in (such as real name, address...)
email optional string (email) Player's email, to create an account so that the player can retrieve his scores if he connects from another device or if he reinstalls the game. The account will be created only if the player does not have one, and the modification of the email is not possible.
password madantory if email is present string (min 8 chars) Account password
Example (JS) :
fetch('https://api.ezladder.net/players/AZ00000002232', {
  method: 'PATCH',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json', 
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  },
  body: JSON.stringify({  
    "name":"The angry pheasant"
  })
}); 
Check if a player exists (and retrieve his information)GET /players/{player_key}
Call the GET /players/{player_key} method. It accepts 1 parameter :
info optional int If this parameter is equal to 1, the player's info field will also be returned
Example (JS) :
fetch('https://api.ezladder.net/players/AZ00000002232?info=1', {
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json', 
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 
Check if a player exists (and retrieve his information), from his accountPOST /players/auth
Calling the POST /players/auth method allows to recover the player_key of a player from his account (email/password).
If the player has an account but has never played the game from which he connects, he is created on this new game with the last nickname he used.
2 required parameters :
email required string (email) Account email
password required string Account password
Exemple (JS) :
  fetch('https://api.ezladder.net/players/auth', {
    method: 'POST',  
    headers: {
      'Accept': 'application/json',  
      'Content-Type': 'application/json', 
      "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
      "timestamp":152525254,
      "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
    },
    body: {
      "email": "test@testemail.com",
      "password": "password"
    }
  }); 
Change the password of a player's accountPOST /players/{player_key}/changePassword
Call the POST /players/{player_key}/changePassword method to change the password of a player's account. This must be related to a voluntary action by the player asking to change his password.
3 required parameters :
old_password required string Current account password
password required string New account password
password_confirmation obligatoire string New account password (confirmation)
Exemple (JS) :
fetch('https://api.ezladder.net/players/P34efabb9043efad4dd37/changePassword', {
  method: 'POST',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json', 
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  },
  body: {
    "old_password": "password",
    "password": "passwordnew",
    "password_confirmation": "passwordnew"
  }
}); 
Init the procedure to reset a player's password (password forgotten)POST /accounts/forgotPassword
Calling the POST /accounts/forgotPassword method starts the procedure allowing a player to reset his password if he has forgotten it.
If the email address sent exists, he will receive a link to define a new password. This link is only valid for 10 minutes.
For security reasons, this method always returns a success HTTP code (200), from the moment the email address sent is syntactically valid, even if it is not known on ezLadder. This method should be called only after a voluntary action of the player meaning that he does not know his password ("Forgotten password" button in most cases).

1 required parameter :
email obligatoire string (email) L'email du compte dont on souhaite réinitialiser le mot de passe
Exemple (JS) :
fetch('https://api.ezladder.net/accounts/forgotPassword', {
  method: 'POST',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json', 
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  },
  body: {
    "email": "email@test.com",
  }
}); 
Start a gamePOST /startGame
The POST /startGame method is used to indicate that a player has started a game. It returns a token which will have to send at each score addition for this game round.
It needs 1 parameter :
player_key required string player_key of the player who starts a game
Example (JS) :
fetch('https://api.ezladder.net/startGame',   
  method: 'POST',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  },
  body: JSON.stringify({  
    "player_key":"AZ00000002232"
  })
});       
Start a multiplayer gamePOST /startGameMulti
The POST /startGameMulti method is used to indicate that one or more players have started a game. It returns a token which will have to send at each score addition for this game round.
This method returns an HTTP 200 code as soon as at least one player has been found. It also returns other information, such as the number of players added to the game and the player_keys of any players not found.
1 required parameter :
player_keys required array of string player_keys of players who start a game
Example (JS) :
fetch('https://api.ezladder.net/startGameMulti',
  method: 'POST',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  },
  body: JSON.stringify({  
    "player_keys":[
      "P34efabb9043efad4dd37",
      "P764b2314eabcbcea4434",
      "Paea3456789000aabbcc3"
    ]
  })
});       

//Sample response
{
  "nbPlayersAddedToGame": 2,
  "playersNotFound": [
    "Paea3456789000aabbcc3",
  ],
  "token": "b8f6175e9f"
}
          
Add one or more players to a gamePOST /addPlayersToGameMulti
In the case a player joins a game in progress, you may want to add him to the list of players who can receive a score during this game.
The POST /addPlayersToGameMulti method allows this.
It returns the same information as the POST /startGameMulti method.
Note that it is possible to add players to a game that was not originally multi-player (created via the POST /startGame method), making it multi-player.
It is not possible to remove players from a game via a dedicated method, but sending a score equal to 0 for the player, with the delete_token option set to 1, allows this.
2 parameters are required :
player_keys required array of string player_keys of the players added to the game
token required string token of a started game, obtained by the POST /startGameMulti or POST /startGame methods
Example (JS) :
fetch('https://api.ezladder.net/addPlayersToGameMulti',
  method: 'POST',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  },
  body: JSON.stringify({  
    "player_keys":[
      "P34efabb9043efad4dd37",
      "P764b2314eabcbcea4434",
      "Paea3456789000aabbcc3"
    ],
    "token": "b8f6175e9f"
  })
});

//Sample response
{
  "nbPlayersAddedToGame": 2,
  "playersNotFound": [
    "Paea3456789000aabbcc3",
  ],
  "token": "b8f6175e9f"
}
  
Send a scorePOST /score
Before you can send a score, you have to get a token with the POST/startGame method
The POST /score method is used to send a score.
It accepts 5 parameters. 3 are always required :
player_key required string player_key of the player who scored
token required string The token of the game round obtained with the /startGame method
score required integer Score
leaderboard_key required if the game has multiple leaderboards string leaderboard_key of the leaderboard for which the score is sent. Not necessary if the game has only one leaderboard.
delete_token optional int If present, remove the token after adding the score, preventing it from being used again
Example (JS) :
fetch('https://api.ezladder.net/score',   
  method: 'POST',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  },
  body: JSON.stringify({  
    "player_key":"AZ00000002232",
    "token":"4eadf555",
    "score":45,
    "leaderboard_key":"R342Ebeb545454ae54aeaf4d5c",
    "delete_token":1
  })
}); 
Send scores of a multiplayer gamePOST /scoreMulti
Before you can send a score, you have to get a token with the POST /startGameMulti or POST /startGame method
The POST /scoreMulti method allows you to send one or more scores, to end the game for one player or for all players.
It returns an HTTP 201 code from the moment when at least one of the scores sent could be added. Likewise, the delete_token parameter only works if at least one of the scores could be added.
Information is returned: the number of scores actually added, the player_keys of players not found and the player_keys of players found but who were not present in the game.
It accepts 4 parameters. 2 are always required :
player_keys required array of string List of player scores, associated with their player_keys (see example below)
token required string The token of the game round obtained with the /startGameMulti or /startGame method
leaderboard_key required if the game has multiple leaderboards string leaderboard_key of the leaderboard for which the score is sent. Not necessary if the game has only one leaderboard.
delete_token optional int If present, remove the token after adding the score, for all players present in this game round, preventing it from being used again
Example (JS) :
fetch('https://api.ezladder.net/scoreMulti',   
  method: 'POST',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  },
  body: JSON.stringify({  
    "player_scores": [
        {
            "player_key": "P34efabb9043efad4dd37",
            "score": 15
        },
        {
            "player_key": "P764b2314eabcbcea4434",
            "score": 22,
            "delete_token": 1 //La partie est terminée pour ce joueur, il ne pourra pas recevoir d'autres scores pour cette partie.
        },
        {
            "player_key": "P32909a07ca4f4db3a1d5",
            "score": 2
        }
    ],
    "token":"4eadf555",
    "leaderboard_key":"L342Ebeb545454ae54aeaf4d5c",
    "delete_token": 1 //Partie terminée pour tous les joueurs, ils ne pourront pas recevoir d'autres scores pour cette partie.
  })
}); 

//Sample response
{
  "nbScoresAdded": 2,
  "playersNotFound": [
      "P32909a07ca4f4db3a1d5"
  ],
  "playersNotInGame": []
}
          
Retrieve the leaderboard of a gameGET /leaderboards/{leaderboard_key}
Call the GET /leaderboards/{leaderboard_key} method to retrieve a game leaderboard.
The following parameters can be added to the URL :
start_date optional date (YYYY-MM-DD format) Start date of the leaderboard
end_date optional date (YYYY-MM-DD format) End date of the leaderboard
paginate optional integer Number of players returned per page
page optional integer Page number
progress_since optional date (YYYY-MM-DD format) If this parameter is given, information on the progression of the players since this date will be returned with the classification (old position, number of places won / lost, score won / lost)
type optional string best_score : The leaderboard will be based on the best score obtained by each player
If this parameter is not present or another value is given, the leaderboard type will be the one you defined for the leaderboard (in Leaderboards > Manage)
sort optional string asc : The scores will be sorted from the smallest to the highest
If this parameter is not present or another value is given, scores will be sorted according to the sorting value you defined for the leaderboard (in Leaderboards > Manage)
info optional integer If this parameter is present and has the value 1, players' info field will also be returned
ignore_negative optional integer If this parameter is present and has the value 1, players with score below 0 will be ignored
Examples (JS) :
//Game's leaderboard
fetch('http://api.ezladder.net/leaderboards/L432043503945034534503453405439', {
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
});

//Top 10, taking into account only the scores from 05/04/2019 to 06/08/2019
fetch('http://api.ezladder.net/leaderboards/L432043503945034534503453405439?start_date=2019-04-05&end_date=2019-08-06&pagination=10&page=1', {
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 

//Leaderboard of the highest score obtained
fetch('http://api.ezladder.net/leaderboards/L432043503945034534503453405439?type=best_score', {
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 
The following predefined classification periods exist : today, yesterday, thisweek, lastweek, thismonth, lastmonth, thisyear, lastyear. These are combinable with others parameters except start_date and end_date.
Example (JS) :
//The 3 players who had the lowest ranking yesterday
fetch('http://api.ezladder.net/leaderboards/L432043503945034534503453405439/yesterday?paginate=3&page=1&sort=asc', {
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
});
Get players's score and rank in a leaderboardGET /leaderboards/{leaderboard_key}/players/{player_key}
The GET /leaderboards/{leaderboard_key}/players/{player_key} method is used to get info of player "player_key" in leaderboard "leaderboard_key". All parameters of GET /leaderboards/{leaderboard_key} method are usable. Predefined classification periods as well as the seasons are usable too.
2 additional parameters exist to get the page of the leaderboard in which the player is located.
leaderboard_page optional integer If equal to 1, the leadeboard page in which the player is located is also returned. The "paginate" parameter is required in this case.
paginate required if leaderboard_page = 1 integer Number of players by leaderboard page
Example (JS) :
fetch('https://api.ezladder.net/leaderboards/L432043503945034534503453405439/players/0000000001',   
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 

fetch('https://api.ezladder.net/leaderboards/L432043503945034534503453405439/players/0000000002/thisMonth',   
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
});

//With the ranking page in which the player is located, 3 players per page
fetch('https://api.ezladder.net/leaderboards/L432043503945034534503453405439/players/0000000002?leaderboard_page=1&paginate=3',   
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 
Get leaderboard informationGET /leaderboards/{leaderboard_key}/info
Get leaderboard's name and the number of players in this leaderboard. You can specify start and / or end dates in order to have only the number of players with scores over that period.
Predefined classification periods are usable (today, thisWeek, ...) as well as seasons (season1, season2, ...)
start_date optional date (YYYY-MM-DD format) Start date of the leaderboard
end_date optional date (YYYY-MM-DD format) End date of the leaderboard
ignore_negative optional integer If this parameter is present and has the value 1, players with score below 0 will be ignored
Example (JS) :
fetch('https://api.ezladder.net/leaderboards/L432043503945034534503453405439/info',   
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 
List all achievements of a gameGET /achievements
This method returns all achievements existing for a game. No parameters are needed.
Example (JS) :
fetch('https://api.ezladder.net/achievements',   
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 
Set achievement progressPOST /players/{player_key}/achievements/{achievement_key}
This method increases the player's progress for achievement with achievement_key.
One parameter is required :
progress required int (min:0, max:100) Achievement progress
Example (JS) :
fetch('https://api.ezladder.net/players/PL00101/achievements/A4de1f25517fc0d7cc53700d2232c055c66bc2e5c2e97b589a3ec64544a8afd10',   
  method: 'POST',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  },
  body: {
    progress: 30
  }
}); 
Get player's achievementsGET /players/{player_key}/achievements
Get all achievements with player's progress.
Example (JS) :
fetch('https://api.ezladder.net/players/PL00101/achievements',   
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 
Get a player's achievementGET /players/{player_key}/achievements/{achievement_key}
Get a player's achievement with player's progress.
Example (JS) :
fetch('https://api.ezladder.net/players/PL00101/achievements/Ae94939493fece3430aa',   
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 
Get events of a gameGET /events
This method returns existing events of a game. 2 parameters are available to filter them.
type optional string Filter by event type
status optional string Filter by event status : active, inactive, future ou past
Example (JS) :
// Get all active events of type 'news'
fetch('https://api.ezladder.net/events?type=news&status=active',   
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 
Get event from event_keyGET /events/{event_key}
This method returns all information about an event.
Example (JS) :
fetch('https://api.ezladder.net/events/E4de1f25517fc0d7cc53700d2232c055c66bc2e5c2e97b589a3ec64544a8afd10',   
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 
Save player's game dataPOST /players/{player_key}/gameData
This method is used to save a player's game data (progress, etc ...). The format of the backup is free (JSON, XML, ...) as long as it does not exceed 16 KB.
Warning: The player must have an ezLadder account to be allowed to save his game data.
1 required parameter :
data required string (16 kB max) Game data
Example (JS) :
fetch('https://api.ezladder.net//players/Pe34eacb76393be00101/gameData', {
  method: 'POST',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json', 
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  },
  body: {
    "save": "{\"level\":5, \"gold\":302}",
  }
}); 
Retrieve player's game dataGET /players/{player_key}/gameData
This method allows to recover the game data of a player previously saved with the POST /players/{player_key}/gameData method.
Example (JS) :
fetch('https://api.ezladder.net/players/Pe34eacb76393be00101/gameData', {
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json', 
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 
Get the seasons of a leaderboardGET /leaderboards/{leaderboard_key}/seasons
ezLadder allows you to create seasons. A season is defined by a start date, an end date, a name and a number.
If no name is defined, the name will simply be "Season N", where N is the season number.
Season numbers are automatically generated and are always consecutive.
The seasons are linked to a leaderboard. Two leaderboards on the same game can have different seasons.
Enable seasons for a leaderboard then allows you to retrieve the players' major results (see below)
This method allows you to get the seasons of a leaderboard. The response received contains the list of seasons in chronological order, as well as its status: "over", "current", "future".
Example (JS) :
fetch('https://api.ezladder.net/leaderboards/Lc30b817a1257c415b349eae453f386b0d9d2034d/seasons', {
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json', 
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 
Get ranking of a seasonGET /leaderboards/{leaderboard_key}/seasonN
This method allows you to get the ranking of season N (as well as some other info, see response example).
All parameters of the GET /leaderboards/{leaderboard_key} method can be used, with the exception of start_date and end_date.
Example (JS) :
// Retrieve info, ranking and major results of season 4
fetch('https://api.ezladder.net/leaderboards/Lc30b817a1257c415b349eae453f386b0d9d2034d/season4', {
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json', 
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 

// Response example
{
  "season": {
    "start_date": "2020-05-06",
    "end_date": "2020-07-20",
    "number": 3,
    "name": "TEST C",
    "status": "current"
  },
  "major_results": [],
  "leaderboard": [
    {
      "name": "ExplosiveFig",
      "avatar": "",
      "score": 14,
      "pos": 1
    },
    {
        "name": "PutridCookie",
        "avatar": "",
        "score": 5,
        "pos": 2
    }
  ]
}
Get major results of a leaderboardGET /leaderboards/{leaderboard_key}/major-results
This method returns all the major results of a leaderboard, season by season.
Example (JS) :
fetch('https://api.ezladder.net/leaderboards/Lc30b817a1257c415b349eae453f386b0d9d2034d/major-results', {
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json', 
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 

// Response example
[
    {
        "start_date": "2019-12-02",
        "end_date": "2020-05-22",
        "number": 1,
        "name": "Season 1",
        "status": "over",
        "major_results": [
            {
                "pos": 1,
                "player": {
                    "name": "UltraPlanet3091",
                    "player_key": "P2340429305439053045394503495e1231232112",
                    "avatar": "",
                    "has_account": false
                }
            },
            {
                "pos": 2,
                "player": {
                    "name": "MollusqueIncontrolable",
                    "player_key": "P034eabc43cb3045394503495e3045394503495e",
                    "avatar": "",
                    "has_account": true
                }
            }
        ]
    },
    {
        "start_date": "2020-03-04",
        "end_date": "2020-07-14",
        "number": 2,
        "name": "Tamagotchi season",
        "status": "over",
        "major_results": [
            {
                "pos": 1,
                "player": {
                    "name": "MollusqueIncontrolable",
                    "player_key": "P034eabc43cb3045394503495e3045394503495e",
                    "avatar": "",
                    "has_account": true
                }
            },
            {
                "pos": 2,
                "player": {
                    "name": "kozika",
                    "player_key": "P234edce4444e8b48ba0d28f10afeaf53b1b3dfac",
                    "avatar": "",
                    "has_account": true
                }
            }
        ]
    }
]
        
Get major results of a playerGET /players/{player_key}/major-results
This method returns all of a player's major results, for all leaderboards in the game, season by season.
Example (JS) :
fetch('https://api.ezladder.net/players/Pc30b817a1257c415b349eae453f386b0d9d2034d/major-results', {
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json', 
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 

// Response example
[
    {
        "leaderboard_name": "Leaderboard",
        "major_results": [
            {
                "season_number": 1,
                "season_name": "Season 1",
                "pos": 2
            },
            {
                "season_number": 2,
                "season_name": "Tamagotchi season",
                "pos": 1
            },
            {
                "season_number": 3,
                "season_name": "TEST C",
                "pos": 1
            }
        ]
    },
    {
        "leaderboard_name": "Blabla",
        "major_results": [
            {
                "season_number": 1,
                "season_name": "Azerty",
                "pos": 1
            }
        ]
    }
]
        
Get the major results of a player for a leaderboardGET /leaderboards/{leaderboard_key}/players/{player_key}/major-results
This method returns major results of a player for a leaderboard, season by season.
Example (JS) :
fetch('https://api.ezladder.net/leaderboards/Lc30b817a1257c415b349eae453f386b0d9d2034d/players/Pc30b817a1257c415b349eae453f386b0d9d2034d/major-results', {
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json', 
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 

// Response example
[
    {
        "season_number": 1,
        "season_name": "Season 1",
        "pos": 2
    },
    {
        "season_number": 2,
        "season_name": "Tamagotchi season",
        "pos": 1
    },
    {
        "season_number": 5,
        "season_name": "TEST C",
        "pos": 1
    }
]
        
Quests
ezLadder allows you to manage daily quests for your players.
A quest is made up of :
- Name
- Description
- Icon
- Score to achieve
- Key, automatically generated by ezLadder

The maximum number of active quests for a player can be freely defined (by default 3, min 0, max 10)
When a player's active quests are retrieve for the first time of the day, if he doesn't have the maximum possible, he obtains a new one.
A player cannot have 2 identical active quests.
Get player's questsGET /players/{player_key}/quests
This method is used to retrieve au player's quests.
If a quest is new, it will have the "new" attribute set to 1. The next time this method is called, this attribute will be changed to 0.
If a quest has just been completed, it will have the "new_completed" attribute set to 1. The next time this method is called, this quest will still be visible, unless the reward_given parameter has been used, or the POST /players/{player_key}/quests/{quest_key}/rewardGiven method has been called.
One parameter exists :
reward_given optional int If reward_given = 1, then the newly completed quests (new_completed = 1) present in the answer will not be returned afterwards.

Example (JS) :
fetch('https://api.ezladder.net/players/Pc30b817a1257c415b349eae453f386b0d9d2034d/quests', {
  method: 'GET',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json', 
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 

// Response example
[
    {
        "name": "The end of the start",
        "quest_key": "Q8313ecac4a8ba14867b4e2a52756e4e0c7ca97e422bf6bf47588a42cff09069b",
        "description": "",
        "steps_required": 100,
        "progress": 50,
        "progress_at": "2020-09-28 11:42:45",
        "progress_percent": 50,
        "new": 0,
        "new_completed": 0,
        "iconURL": "url"
    },
    {
        "name": "Too strong",
        "quest_key": "Q5b52e272b3056d9e0a176d2860550557efdcf80830775b610c5bcb146626b8b8",
        "description": "",
        "steps_required": 100,
        "progress": 0,
        "progress_at": "2020-09-28 12:18:05",
        "progress_percent": 0,
        "new": 1,
        "new_completed": 0,
        "iconURL": "url"
    }
]
        
Set quest progressPATCH /players/{player_key}/quest/{quest_key}
This method increases the player's progress for the quest with the quest_key key.
A parameter is required :
progress required int Quest progress
Example (JS) :
fetch('https://api.ezladder.net/players/Pc30b817a1257c415b349eae453f386b0d9d2034d/quests/Q5b52e272b3056d9e0a176d2860550557efdcf80830775b610c5bcb146626b8b8',   
  method: 'POST',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  },
  body: {
    progress: 30
  }
}); 
        
Replace a questPATCH /players/{player_key}/quest/{quest_key}/replace
This method gives to the player a new quest instead of the quest with the quest_key key. The new quest will necessarily be different from the replaced one. If the replaced quest was the only one available, no quest will be obtained instead.

Example (JS) :
fetch('https://api.ezladder.net/players/Pc30b817a1257c415b349eae453f386b0d9d2034d/quests/Q5b52e272b3056d9e0a176d2860550557efdcf80830775b610c5bcb146626b8b8/replace',   
  method: 'PATCH',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
}); 
        
Hide a completed quest (reward given)PATCH /players/{player_key}/quest/{quest_key}/rewardGiven
This method is used to indicate that a reward has been given to the player for completing the quest. So this quest will no longer be returned during future calls to GET /players/{player_key}/quests.

Example (JS) :
fetch('https://api.ezladder.net/players/Pc30b817a1257c415b349eae453f386b0d9d2034d/quests/Q5b52e272b3056d9e0a176d2860550557efdcf80830775b610c5bcb146626b8b8/rewardGiven',   
  method: 'PATCH',  
  headers: {
    'Accept': 'application/json',  
    'Content-Type': 'application/json',  
    "game-key":"eae87e4f74b9f4f716a2faf45325e2473d4484923d91779b0dcf6feaf5e78003",  
    "timestamp":152525254,
    "signature":"2faf45325e2473d44849232faf45325e2473d4484923"
  }
});