- Client-Server API
- Overview
- Errors
- Endpoints
POST /zv/usersHEAD /zv/users/{user_id}GET /zv/users/{user_id}PATCH /zv/users/{user_id}DELETE /zv/users/{user_id}POST /zv/users/{user_id}/tasksHEAD /zv/users/{user_id}/tasks/{task_id}GET /zv/users/{user_id}/tasks/{task_id}PUT /zv/users/{user_id}/tasks/{task_id}DELETE /zv/users/{user_id}/tasks/{task_id}
- Media Types
This API is exposed to the clients through a number of endpoints accepting JSON payloads.
In the case of any errors, server's response payload would be of type Error.
Here are the general expected Zevere error codes based on HTTP status code in the response:
400:zv.error.invalid: Validation errors. In this case, payload contains thevalidation_errorsarray.
404:zv.error.not-found: Resource does not exist.
415:zv.error.not-supported: Media type is not supported for this endpoint and method.
500:zv.error.fault: Server failed to process the request.
Some Endpoints might accept more than one media types in request and return more than one form of representation in response. You can see the full list here.
Create a new user
- Acceptable Request Content Types:
- Expectable Response Media Types:
- Responses:
201: User created204(ifapplication/vnd.zv.emptymedia type requested): User created409: A user with the same username already exists
Check existence of a user by ID
- Path Parameters:
user_id: id of the user
- Responses:
204: User exists
Get a user by ID
- Path Parameters:
user_id: id of the user
- Expectable Response Media Types:
- Responses:
200
Partially update user information
- Path Parameters:
user_id: id of the user
- Acceptable Request Content Types:
- Expectable Response Media Types:
- Responses:
202: User info updated204(ifapplication/vnd.zv.emptymedia type requested): User info updated
Remove a user
- Path Parameters:
user_id: id of the user
- Responses:
204: User removed
Create a new task for the user
- Path Parameters:
user_id: id of the user
- Acceptable Request Content Types:
- Expectable Response Media Types:
- Responses:
201: Task created204(ifapplication/vnd.zv.emptymedia type requested): Task created
Check existence of a task for user by ID
- Path Parameters:
user_id: id of the usertask_id: id of the task
- Responses:
204: Task exists for that user
Get a task for user by ID
- Path Parameters:
user_id: id of the usertask_id: id of the task
- Expectable Response Media Types:
- Responses:
200
Update or create a task for user with the specified task_id
- Path Parameters:
user_id: id of the usertask_id: id of the task
- Acceptable Request Content Types:
- Expectable Response Media Types:
- Responses:
201: Task created/updated204(ifapplication/vnd.zv.emptymedia type requested): Task created/updated409: A task with the same id already exists for this user
Remove a task for user
- Path Parameters:
user_id: id of the usertask_id: id of the task
- Responses:
204: Task removed
Each type might have different representations. Listed below are types, their various representations, and their custom mime-type names.
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | ✔ | User's ID |
| first_name | string | ✔ | User's first name |
| last_name | string | User's last name | |
| joined_at | datetime | ✔ | The date account was created in UTC format. Time should be set to the midnight. |
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | ✔ | User's ID |
| display_name | string | ✔ | User's name that contains first name and optional last name appended with a space character. |
| days_joined | number | ✔ | Number of days this user has joined. |
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | ✔ | The desired user name |
| passphrase | string | ✔ | Passphrase as clear text |
| first_name | string | ✔ | User's first name |
| last_name | string | User's last name |
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | ✔ | Task's ID |
| title | string | ✔ | A title/summary for task. Should be 140 characters or less. |
| description | string | More description for task | |
| created_at | datetime | ✔ | The date and time this task was created in UTC format. |
| due_by | datetime | The date and time this task would be due. Should always be at least 60 seconds after created_at. |
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | ✔ | Task's ID |
| title | string | ✔ | A title/summary for task. Should be 140 characters or less. |
| description | string | More description for task | |
| is_due | boolean | ✔ | Whether task's due date and time is passed. |
| due_in | string | Only if is_due is false, contains a user readable representation of the time left such as 2 days 5 minutes. |
| Name | Type | Required | Description |
|---|---|---|---|
| title | string | ✔ | A title/summary for task. Should be 140 characters or less. |
| description | string | More description for task | |
| due_by | datetime | The date and time this task would be due. Should always be at least 60 seconds after the time of making request. |
| Name | Type | Required | Description |
|---|---|---|---|
| patches | FieldUpdate[] |
✔ | An array of field updates |
| Name | Type | Required | Description |
|---|---|---|---|
| field | string | ✔ | Name of the field to be updated |
| value | string | ✔ | New value for the field |
| Name | Type | Required | Description |
|---|---|---|---|
| code | string | ✔ | Machine readable error code |
| message | string | ✔ | User readable error message describing what went wrong |
| validation_errors | ValidationError[] |
An array of errors ocurred in validation. |
| Name | Type | Required | Description |
|---|---|---|---|
| field | string | ✔ | Name of the field that caused the failure |
| message | string | ✔ | User readable error message describing the failure reason |
| hint | string | User readable hint message instructing the user how to resolve the issue |
This media type indicates an empty object and is useful for times that client doesn't need the response body in the case of a successful request. This results in a response status code of 204.