This API reference is for version 2 and many of the additional features will not work in the older v1. Every request will require your api key (gamekey). This is your private key, keep it secure and do not share it. With it, someone could ruin your scoreboard.
Get Scores
https://purpletoken.com/update/v2/get_score?gamekey={key_id}Query Parameters
gamekey = {key_id} required dates = {yes|no} (default 'no') format = {csv|json|xml} (default 'csv') limit = {int32} (Num of scores to return, default is 20) ids = {yes|no} (default 'no') array = {yes|no} (default 'no')
Sample of json response with default settings:
{"count":3,"scores":[{"id":123,"player":"john","score":8646,"date":"2024-02-21 02:13:49"}, {"id":135,"player":"mary","score":8480,"date":"2024-02-21 12:09:17"}, {"id":97,"player":"jeff","score":6012,"date":"2024-02-20 01:27:49"}]}CSV example output:
3,123,john,8646,2024-02-21 02:13:49,135,mary,8480,2024-02-21 12:09:17,97,jeff,6012,2024-02-20 01:27:49The only reason you would ever need to include the IDs with the score retrieval is if you intend on deleting a score.
To clarify on the array parameter, if 'yes' then the result will only be an array of the score objects. The count will not be included and 'scores' key is also dropped, leaving only the array structure. This only applies to the CSV and JSON formats and has no effect on XML.
Submit Scores
https://purpletoken.com/update/v2/submit_scoreQuery Parameters
gamekey = {key_id} required player = {player_name} required (max 32 chars) score = {int32} required
Delete Scores
By default, the API will not allow you to delete scores remotely. This option must be explicitly turned on from your account page.
https://purpletoken.com/update/v2/delete_scoreQuery Parameters
gamekey = {key_id} required score_id = {int32} required all = {yes|no} (if yes, all scores associated with this key are deleted)