Amadis
Administration APIs - User
- 1 Define a new user
- 1.1 Response code
- 1.2 Response data
- 2 Update a user password
- 2.1 Response code
- 2.2 Response data
- 3 Reset a user password
- 3.1 Response code
- 3.2 Response data
- 4 GET all users or a specific one
- 4.1 Response code
- 4.2 Response data
- 5 PATCH a user
- 5.1 Response code
- 5.2 Response data
- 6 DELETE a user
- 6.1 Response code
- 6.2 Response data
Define a new user
This API allows registering a user:
Verb | POST |
Resource | /api/user/v1/register |
Content type | application/x-www-form-urlencoded |
Body | name=<name>& email=<email>& password=<password> |
Where:
Field | Description |
name | The user name |
The user email address | |
password | The user password |
Response code
The expected response code is 201
Response data
The response data is a JSON object with the following structure:
{ | Field | Description |
| “status”: “success”, | Request successful |
| “data”: { | Response data |
| “id”: <id> | Item ID in DB (int) |
| “user_id”: “<user Id>” | User ID (String) |
| “user_secret”:”<user secret>” | A base64 encoded 32 byte secret |
| } |
|
} |
|
|
Update a user password
This API allows to update an existing user password:
Verb | PATCH |
Resource | /api/user/v1/changepassword |
Content type | application/x-www-form-urlencoded |
Arguments | email=<email>& oldpassword=<old password>& newpassword=<new password> |
Where:
Field | Description |
The user email address | |
oldpassword | The user current password |
newpassword | The desired new user password |
Response code
The expected response codes are:
200: OK
400: wrong old password
Response data
The response data is a JSON object with the following structure:
{ | Field | Description | Mandatory / Optional |
| “status”: “success”, | Request successful | M |
| “data”: { |
| O |
| “error”: “<message>” | Error message | O |
| } |
|
|
} |
|
|
|
Reset a user password
This API allows resetting a user password (backend generated)
Verb | PATCH |
Resource | /api/user/v1/resetpassword |
Content type | application/x-www-form-urlencoded |
Body | email=<email> |
Where:
Field | Description |
The user email address |
Response code
The expected response code is 200
Response data
The response data is a JSON object with the following structure:
{ | Field | Description |
| “status”: “success”, | Request successful |
| “data”: { | Response data |
| "email": "<email>", | The user email |
| "password": "<new password>” | The new generated password |
| } |
|
} |
|
|
GET all users or a specific one
This API allows retrieving the list of users:
Verb | GET |
Resource | /api/datamanagement/v1/User(/{id}) |
Content type | application/x-www-form-urlencoded |
Body | N/A |
Response code
The expected response code is 200
Response data
The response data is a JSON object with the following structure:
{ | Field | Description |
| “statusCode”: 200, | Request successful |
| “User”: [ | User(s) |
| { |
|
| “id”: <user Id> | User ID (int) |
| "name": "<name>", |
|
| "email": "<email>", |
|
| "email_verified_at": null, |
|
| "password": "<password>", | Blowfish hashed |
| "remember_token": null, |
|
| "created_at": null, |
|
| "updated_at": null |
|
| }, |
|
| …. |
|
| ] |
|
} |
|
|
PATCH a user
This API allows updating an existing user:
Verb | PATCH |
Resource | /api/datamanagement/v1/User/{id} |
Content type | application/json |
Body | { |
“data”: { | |
“name”: “…”, | |
… | |
} | |
} |
Response code
The expected response code is 200
Response data
N/A
“password” cannot be changed using that route. Use /api/user/v1/changepassword or /api/user/v1/resetpassword instead.
DELETE a user
This API allows updating an existing user:
Verb | DELETE |
Resource | /api/datamanagement/v1/User/{id} |
Content type | application/x-www-form-urlencoded |
Body | N/A |
Response code
The expected response code is 200
Response data
N/A