To start your new Phoenix application:
- Install dependencies with
mix deps.get
- Start Phoenix endpoint with
mix phoenix.server
Now you can visit localhost:4000
from your browser.
GET /api/users/:user_id/characters
Returns a list of characters where user_id == a user.key (unique device identifier)
Example:
curl http://thegame.com/users/some_key/characters
GET /api/users/:user_id/characters/:id
Returns a single character who's id == :id and where user_id == a user.key (unique device identifier)
Query Params: id :: Integer
Example:
curl http://thegame.com/users/some_key/characters/1
POST /api/users/:user_id/characters
where user_id == a user.key
Params: Required:
- name :: String
- level :: Integer
- class_id :: Integer
- user_id :: Integer
PATCH /api/users/:user_id/characters/:id
PUT /api/users/:user_id/characters/:id
where user_id == a user.key
Params: Optional:
- name :: String
- level :: Integer
- class_id :: Integer
- user_id :: Integer
where user_id == a user.key
DELETE /api/users/:user_id/characters/:id
GET /api/classes
Example:
curl http://thegame.com/api/classes
GET /api/classes/:id
POST /api/classes
Params: Required:
- name :: String
PATCH /api/classes/:id
PUT /api/classes/:id
Params: Required:
- name :: String
DELETE /api/classes/:id
GET /api/users
GET /api/users/:id
POST /api/users
Params: Required:
- name :: String
- username :: String
- key :: String - a unique device identifier
- lat :: Ingteger
- long :: Integer
PATCH /api/users/:id
PUT /api/users/:id
Params: Optional:
- name :: String
- username :: String
- lat :: Ingteger
- long :: Integer
DELETE /api/users/:id