2014-08-27 07:08:26 +04:00
FORMAT: 1A
HOST: https://api-galaxy.dev.mozaws.net
# Galaxy API
## Current Version
2014-09-05 01:55:10 +04:00
By default, all requests receive the __v1__ version of the API. We encourage you to explicitly request the version via the `Accept` header:
2014-08-27 07:08:26 +04:00
Accept: application/vnd.galaxy.v1+json
2014-09-05 01:55:10 +04:00
## Schema
All API access is over HTTPS and is accessed from the api-galaxy.dev.mozaws.net origin. All data is sent and received as JSON.
Blank fields are included as null instead of being omitted.
All timestamps are returned in ISO 8601 format:
YYYY-MM-DDTHH:MM:SSZ
2014-08-27 07:08:26 +04:00
# Group Game
2014-09-08 10:37:52 +04:00
## Game [/games/{game_slug}]
2014-08-27 07:08:26 +04:00
2014-08-27 07:26:40 +04:00
+ Parameters
+ game_slug (string, `pokemon`) ... The slug of the Game.
+ Model (application/json)
```js
{
"description": "Full Screen Pokemon is an open source HTML5 remake of the original Pokemon games. You can play the original two generations (Red/Blue through Crystal), literally billions of procedurally generated maps, or create your own using the level editor.",
2014-08-30 02:29:10 +04:00
"game_url": "http://www.fullscreenpokemon.com/",
"slug": "pokemon",
2014-08-27 07:26:40 +04:00
"name": "Pok\u00e9mon"
}
```
### Retrieve a Game [GET]
Returns a specific Game.
+ Response 200 (application/json)
[Game][]
### Delete a Game [DELETE]
Delete a Game. The current user must be the same user who created the Game (or be an admin).
2014-08-27 07:08:26 +04:00
+ Response 200 (application/json)
2014-08-27 07:26:40 +04:00
```js
{
"success": true
}
```
### Update a Game [PATCH]
Update the fields of the Game.
+ Request (application/json)
[Game][]
+ Response 200 (application/json)
```js
{
"success": true
}
```
## Game Collection [/games]
A collection of Games.
+ Model (application/json)
```js
[
2014-08-27 07:08:26 +04:00
{
2014-08-27 07:26:40 +04:00
"description": "Full Screen Pokemon is an open source HTML5 remake of the original Pokemon games. You can play the original two generations (Red/Blue through Crystal), literally billions of procedurally generated maps, or create your own using the level editor.",
2014-08-30 02:29:10 +04:00
"game_url": "http://www.fullscreenpokemon.com/",
"slug": "pokemon",
2014-08-27 07:08:26 +04:00
"name": "Pok\u00e9mon"
2014-08-27 07:26:40 +04:00
},
...
]
```
### Create a Game [POST]
To create a new Game object simply provide a JSON blob of the attributes of the new Game.
+ Request (application/json)
[Game][]
+ Response 200 (application/json)
```js
{
"success": true
}
```
### Retrieve all Games [GET]
Returns a list of the Games available for a particular game.
+ Response 200 (application/json)
[Game Collection][]
2014-08-27 07:08:26 +04:00
# Group Leaderboard
2014-09-08 10:37:52 +04:00
## Leaderboard [/games/{game_slug}/leaderboards/{board_slug}]
2014-08-27 07:08:26 +04:00
+ Parameters
2014-08-27 07:26:40 +04:00
+ game_slug (string, `pokemon`) ... The slug of the Game.
+ board_slug (string, `pokeballs-collected`) ... The slug of the Leaderboard.
2014-08-27 07:08:26 +04:00
+ Model (application/json)
```js
{
2014-08-27 07:26:40 +04:00
"slug": "pokeballs-collected",
"description": "This keeps track of how many pok\u00e9balls a user finds.",
"name": "Pok\u00e9balls Collected"
2014-08-27 07:08:26 +04:00
}
```
### Retrieve a Leaderboard [GET]
Returns a specific Leaderboard.
+ Response 200 (application/json)
[Leaderboard][]
### Delete a Leaderboard [DELETE]
Delete a Leaderboard. The current user must be the same user who created the Leaderboard (or be an admin).
+ Response 200 (application/json)
```js
{
2014-08-27 07:26:40 +04:00
"success": true
2014-08-27 07:08:26 +04:00
}
```
### Update a Leaderboard [PATCH]
2014-08-27 07:26:40 +04:00
Update the fields of the Leaderboard.
2014-08-27 07:08:26 +04:00
+ Request (application/json)
[Leaderboard][]
+ Response 200 (application/json)
```js
{
2014-08-27 07:26:40 +04:00
"success": true
2014-08-27 07:08:26 +04:00
}
```
2014-09-08 10:37:52 +04:00
## Leaderboard Score [/games/{game_slug}/leaderboards/{board_slug}/scores]
2014-08-27 07:08:26 +04:00
+ Parameters
2014-08-27 07:26:40 +04:00
+ game_slug (string, `pokemon`) ... The slug of the Game.
+ board_slug (string, `pokeballs-collected`) ... The slug of the Leaderboard.
2014-08-27 07:08:26 +04:00
### Add a Score [POST]
Updates the score for a Leaderboard board for a particular game.
+ Request (application/json)
```js
{
2014-08-27 07:26:40 +04:00
"user": "cvan"
"score": 50
2014-08-27 07:08:26 +04:00
}
```
+ Response 200 (application/json)
```js
{
2014-08-27 07:26:40 +04:00
"success": true
2014-08-27 07:08:26 +04:00
}
```
2014-08-27 07:26:40 +04:00
### Retrieve all Scores [GET]
+ Response 200 (application/json)
```js
[
{
"member": "rick",
"score": "101"
},
{
"member": "mark",
"score": "99"
},
{
"member": "toby",
"score": "84"
},
{
"member": "david",
"score": "72"
},
{
"member": "cvan",
"score": "50"
},
{
"member": "bill",
"score": "39"
},
{
"member": "wil",
"score": "4"
}
]
```
2014-09-08 10:37:52 +04:00
## Leaderboard Collection [/games/{game_slug}/leaderboards]
2014-08-27 07:08:26 +04:00
A collection of Leaderboards.
+ Model (application/json)
```js
[
{
2014-08-27 07:26:40 +04:00
"slug": "pokeballs-collected",
"description": "This keeps track of how many pok\u00e9balls a user finds.",
"name": "Pok\u00e9balls Collected"
2014-08-27 07:08:26 +04:00
},
...
]
```
### Create a Leaderboard [POST]
2014-08-27 07:26:40 +04:00
To create a new Leaderboard object simply provide a JSON blob of the attributes of the new Leaderboard.
2014-08-27 07:08:26 +04:00
+ Request (application/json)
```js
{
"name": "Name of Leaderboard",
"string": "Slug of Leaderboard"
}
```
+ Response 200 (application/json)
```js
{
2014-08-27 07:26:40 +04:00
"success": true
2014-08-27 07:08:26 +04:00
}
```
### Retrieve all Leaderboards [GET]
Returns a list of the Leaderboards available for a particular game.
+ Response 200 (application/json)
[Leaderboard Collection][]