-
Notifications
You must be signed in to change notification settings - Fork 1
Users endpoint
Kirill Ponomarev edited this page Mar 22, 2023
·
4 revisions
The Users endpoint enables sign up procedure and return of information about the current user. Following operations are available:
HTTP Method | Description |
---|---|
POST | Create new user (sign up procedure) |
GET | Get current user |
The API accepts and returns JSON. The request and response for each operation is described below.
POST /users
Parameter | Type | Required | Nullable | Description |
---|---|---|---|---|
id | string | Yes | No | The ID of the new user |
string | Yes | No | The email of the new user | |
master_password_hash | string | Yes | No | The master password hash of the new user |
hint | string | No | No | The hint of the new user to reset master password |
HTTP Status Code | Response Body |
---|---|
201 | { |
409 | { "message": { "error": "Resource Already Exists. User with id <user_id> already exists" } } |
409 | { "message": { "error": "Resource Already Exists. User with this email already exists" } } |
400 | { "message": { "email": "This JSON body argument is missing at all or it's value is null" } } |
400 | { "message": { "email": "This JSON body argument is an empty string"} } |
422 | { "message": { "error": "Unprocessable Entity. Error while sending an email. The recipient address probably not valid" } } |
GET /users
This request requires authentication, token recieved after login procedure included in x-access-token
header.
This request body does not require a request body or query parameters.
{
"id": "example_id",
"email": "example_email",
"hint": "example_hint"
}