A user Module for a organization
{
"username" : string,
"email" : sting,
"password" : string,
"roles" : array,
}
All the API endpoints return a JSON representation of the resources created or edited. However, if an invalid request is submitted, or some other error occurs, some a error statuscodes will be received
POST /api/register
{
"username" : string,
"email" : sting,
"password" : string,
"roles" : array,
}
POST /api/login
body
{
"username" : string,
"password" : string,
}
PUT /api/:id
{
"username" : string(optional),
"email" : sting(optional),
"password" : string(optional),
"roles" : array(optional),
}
token "Bearer TOKEN"
POST /api/addrole/:role/:id
Only Admin can be able to assign new roles to new users
token "Bearer TOKEN"
POST /api/removerole/:role/:id
Only Admin can be able to remove roles from a user
token "Bearer TOKEN"
POST /api/ref-token
Each time the token will expire after 2 minntus, to refresh the token a refress token is needed which will e created during login.
reftoken "Bearer REFTOKEN"
value | Description |
---|---|
0 | admin |
1 | hr |
2 | project manager |
3 | team leader |
4 | team member |
Gophish returns the following status codes in its API:
Status Code | Description |
---|---|
200 | OK |
201 | CREATED |
400 | BAD REQUEST |
404 | NOT FOUND |
500 | INTERNAL SERVER ERROR |