Verb | Noun (item) | Method Name |
---|---|---|
List | User | ListUser / User::list |
Get | User | GetUser / User::get |
Create | User | CreateUser / User::create |
Update | User | UpdateUser / User::update |
Rename | User | RenameUser User::rename |
Delete | User | DeleteUser / User::delete |
Nouns are ALWAYS singular. This scheme should also match database tables and fields.
(inside DB resources here)
{
"success": true,
"code": 200,
"message": null, /* optional success message */
"data": /* application-specific data would go here */
{
"id": 123,
"name": "Testing Test"
}
}
Version 1 (boolean)
|
Version 2 (with data)
|
{
"success": false,
"code": 200,
"message": null,
"errors": [
{
"error_code": "BAD_VALIDATION",
"message": [
"ERROR: Testing Test Error"
]
}
]
}
Version 1 (boolean) | Version 2 (with data) |
|
|