High Score Web Service Documentation
Introduction
High scores can be retrieved in XML using the URL http://hereforbeer.caffinated.net/scores/queryScores.php. Different GET parameters can be specified to modify the default output. The following describes the returned data and possible parameters for querying the high score database.
General Output
Every response will contain at least the following:
<?xml version="1.0"?> <result returncode="integer" message="string"/>
- returncode is an integer indicating whether the action was successful. 0 means success, any other integer indicates failure.
- message is a string containing more information about the success or failure to execute the specified action.
Get Scores
http://hereforbeer.caffinated.net/scores/queryScores.php?action=getScores
Data Returned
The getScores action returns all scores ordered from highest score to lowest score in the following format:
<?xml version="1.0"?> <result returncode="0" message="Success"> <score> <name>test</name> <points>1234567890123</points> </score> <score> <name>Chris Schwerdt</name> <points>123</points> </score> </result>
- name is the name associated with the score.
- points is the score obtained and may be as large as 264-1 (unsigned 64-bit integer)
Parameters
The following parameters are optional and may be appended to the URL to modify the request. Example: http://hereforbeer.caffinated.net/scores/queryScores.php?action=getScores&name=John&orderBy=name&orderByType=ASC
- name
- A string containing a name to search the database for. The search is a wildcard search and returns all scores matching *name*. This means a request where name=ohn would return scores for "John Doe", "John", etc.
- Default Value: No name filtering
- orderBy
- Chooses the field to order the result by. This can either be "name", or "score".
- Default Value: score
- orderByType
- Chooses what type of ordering to do, may be either "ASC" or "DESC" for ascending or descending.
- Default Value: DESC
- start
- Chooses which record to start returning data at. This, combined with the next parameter, count, allows for pagination of results.
- Default Value: 0
- count
- Chooses how many records to return.
- Default Value: Infinity (all records)