2014-08-27 07:08:26 +04:00
FORMAT: 1A
HOST: https://api-galaxy.dev.mozaws.net
# Galaxy API
## Current Version
By default, all requests receive the __v1__ version of the API. We encourage you to explicitly request this version via the `Accept` header.
Accept: application/vnd.galaxy.v1+json
# Group Game
2014-08-27 07:26:40 +04:00
## Game [/game/{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
{
"app_url": "http://www.fullscreenpokemon.com/",
"slug": "pokemon",
"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.",
"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
"app_url": "http://www.fullscreenpokemon.com/",
"slug": "pokemon",
"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-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
## Leaderboard [/game/{game_slug}/boards/{board_slug}]
+ 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
}
```
## Leaderboard Score [/game/{game_slug}/boards/{board_slug}/scores]
+ 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-08-27 07:08:26 +04:00
## Leaderboard Collection [/game/{game_slug}/boards]
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][]