-
Notifications
You must be signed in to change notification settings - Fork 0
REST API Documentation
The API has three main types of entities: games, matches and users. A game represents a set of matches with unique gameplay. For example, Quadrow is a game. A match represents an instance of a game between two or more players. A user represents a player in a match.
https://api.aerodeck.io/
Games are defined by the server and thus read-only.
Returns the list of games supported.
`curl -X GET https://api.aerodeck.io/v1/games``
{
"games": [
{
"name": "Quadrow",
"description": "Your favorite four in a row game",
"path": "quadrow"
}
]
}
User objects are read-only unless they represent currently authenticated user, which case they are writable.
Creates a new user.
curl -v -H "Content-Type: application/json" -X POST -d
'{
"full_name": "Craig Federighi",
"username": "HairForceOne",
"email": "[email protected]",
"password": "abc123",
"apn": [ "702bf7acff343b63b25c0a91c62ad1ef" ],
"gcm": [ "4f5738aecc5979dedb8b1ed8b3a3257a" ]
}' https://api.aerodeck.io/v1/users
-
400 Bad Request
- Certain required parameters were missing
Returns the list of users created.
curl -X GET https://api.aerodeck.io/v1/users
{
[
{
"fullName":"Jared Wright",
"username":"jawerty",
"email":"[email protected]",
"created":"Sat Jan 12 2013 20:27:36 GMT-0500 (EST)",
"updated":"Sat Feb 22 2013 10:17:38 GMT-0500 (EST)",
"_id":"50f20d8a9aa8036d77000002",
"__v":0,
"gcm":["4f5738aecc5979dedb8b1ed8b3a3257a"],
"apn":["702bf7acff343b63b25c0a91c62ad1ef"]
},
{
"fullName":"Craig Federighi",
"username":"HairForceOne",
"email":"[email protected]",
"created":"Sat Jan 12 2013 20:27:36 GMT-0500 (EST)",
"updated":"Sat Jan 12 2013 20:27:36 GMT-0500 (EST)",
"_id":"50f32209a1894ab49e000002",
"__v":0,
"gcm":["4f5738aecc5979dedb8b1ed8b3a3257a"],
"apn":["702bf7acff343b63b25c0a91c62ad1ef"]
}
]
}
The /v1/users end point performs one query parameter.
curl -X GET /v1/users?username=fakeuser
The username query will respond with data from the username requested.
{
"fullName": "john doe",
"username": "fakeuser",
"email": "johndoe@###.xxx",
"apn": "702bf7acff343b63b25c0a91c62ad1ef",
"created": "Sat Jan 12 2013 20:27:36 GMT-0500 (EST)",
"updated": "Sat Feb 22 2013 10:17:38 GMT-0500 (EST)",
"_id": "50f20d8a9aa8036d77000002",
"__v": 0,
"gcm": [
"4f5738aecc5979dedb8b1ed8b3a3257a"
],
"apns": [
"702bf7acff343b63b25c0a91c62ad1ef"
]
}
### /v1/users/:userid
#### GET
Returns a single user's **fixed** data
#### Sample request
`curl -X GET http://localhos:8000/users/50f32209a1894ab49e000002`
#### Sample response
{ "fullName":"Craig Federighi", "username":"HairForceOne", "created":"Sat Jan 12 2013 20:27:36 GMT-0500 (EST)", "updated":"Sat Jan 12 2013 20:27:36 GMT-0500 (EST)" }