Postman Documentation here.
BaseURL: https://mudierthegame.herokuapp.com/api/
POST - Register a new user
Endpoint: /registration/
Requires an object with a username, password1 and password2:
{
"username": "testuser123",
"password1": "password123",
"password2": "password123"
}
When successful will return status code of 201 (CREATED), and an object containing the key/token (example):
{
"key": "39ef2ef932da123b8f91955b813be06fa123ffd3"
}
POST - Login an existing user
Endpoint: /login/
Requires an object with a username, password:
{
"username": "testuser123",
"password": "password123"
}
When successful will return status code of 200 (OK), and an object containing the key/token (example):
{
"key": "39ef2ef932da123b8f91955b813be06fa123ffd3"
}
GET - Get user's intial room
Endpoint: /adv/init/
Requires Authorization key in headers with token as the value.
When successful will return status code of 200 (OK), and an object containing the user and room details (example):
{
"uuid": "a303434f-e5cc-4a5a-9ad9-46d7ac24c75b",
"name": "testuser",
"title": "hive-e87",
"x_coor": 0,
"y_coor": 42,
"description": "Son a Bee***, this planet smells of adj geyser",
"nextRooms": [
{
"n": 1027
},
{
"e": 1051
},
{
"s": 1071
},
{
"w": 0
}
],
"players": []
}
POST - Move user to another room
Endpoint: `/adv/move/`Requires Authorization key in headers with token as the value.
Requires a request object with the direction:
{
"direction": "n"
}
When successful will return status code of 200 (OK), and an object containing the user and room details (example):
{
"name": "admin",
"title": "hive-w315",
"description": "Perplexed by the ordinary twin stars, you trod along past the invisible, habitat.",
"players": [],
"nextRooms": [
{
"n": 1005
},
{
"e": 1028
},
{
"s": 1050
},
{
"w": 0
}
],
"error_msg": ""
}
GET - Get all rooms
Endpoint: `/adv/matrix/`No token, request body, or headers required.
Requires a response object with the direction:
{
"direction": "n"
}
When successful will return status code of 200 (OK), and an array of arrays containing 1s ## and 0s that signify which are rooms and which are not.