Api Spec
Note: These are setup for the dev's working on the frontend to know the following:
- Routes
- Route Parameters
- Responses
INMATES EXAMPLE
API Inmates
List / Search Inmates
GET: /api/inmates
Params: {
term: 'Johnny Schuster',
pin: null,
dob: null,
cell_location: null,
}
Response: {
"data": [
{
"first_name": "Johnny",
"last_name": "Schuster",
"gender": "male",
"token": "82kNnfxyMuOkPsEPDa4HOpFD8fIkfU",
"disabled": false
}
],
"links": {
"first": "http:\/\/localhost\/api\/inmates?page=1",
"last": "http:\/\/localhost\/api\/inmates?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "http:\/\/localhost\/api\/inmates",
"per_page": 10,
"to": 1,
"total": 1
},
"success": true
}
View A Inmate
GET: /api/inmates/{inmateToken}
Params: null
Response: {
"success": true,
"data": {
"first_name": "Brook",
"last_name": "Romaguera",
"gender": "male",
"token": "vDbQNROmoTrgcDesYuQ8aCbfJjqdhu",
"disabled": false,
"facility": {
"id": 31,
"name": "Leannon Ltd"
}
},
"message": ""
}
Update A Inmate (Employees Only)
PUT: /api/inmates/{inmateToken}
Params: {
disabled: true
}
Response: {
"success": true,
"data": {
"first_name": "Reinhold",
"last_name": "Hermiston",
"gender": "male",
"token": "kEYjRUUBgRCsSSkURAgyzyfRxHBqYn",
"disabled": true
},
"message": ""
}
DELETE An Inmate (Admin Employee Only)
DELETE: /api/inmates/{inmateToken}
Params: null
Response: {
"success": true,
"data": [
],
"message": ""
}