-
Notifications
You must be signed in to change notification settings - Fork 1
Additional Fields endpoint
The Additional Fields endpoint enables users to manage their Additional fields. Additional fields are linked to records, they can't exist independently. Users can perform the following operations:
HTTP Method | Description |
---|---|
POST | Create a new additional field |
PUT | Edit an existing additional field |
DELETE | Delete an additional field |
GET | Get all additional fields for the specific record |
This endpoint requires authentication, token recieved after login procedure included in x-access-token
header.
The API accepts and returns JSON. The request and response for each operation is described below.
POST /additional_fields
Parameter | Type | Required | Nullable | Encrypted | Description |
---|---|---|---|---|---|
id | string | Yes | No | No | The ID of the new additional field |
name | string | Yes | No | Yes | The name associated with the new additional field |
value | string | Yes | No | Yes | The value (content) for the new additional field |
record_id | string | Yes | No | No | The record id associated with the new additional field |
HTTP Status Code | Response Body |
---|---|
201 | { |
404 | { "message": { "error": "Resource Not Found. Record with id <record_id> doesn't exist" } } |
403 | { "message": { "error": "Access Denied. Record <record_id> doesn't belong to the current user <user_id>" } } |
409 | { "message": { "error": "Resource Already Exists. Additional field with id <additional_field_id> already exists" } } |
400 | { "message": { "name": "This JSON body argument is missing at all or it's value is null" } } |
400 | {"message": { "value": "This JSON body argument is in wrong format. Correct format is IV:Data", "name": "This JSON body argument is an empty string"} } |
PUT /additional_fields
Parameter | Type | Required | Nullable | Encrypted | Description |
---|---|---|---|---|---|
id | string | Yes | No | No | The ID of the existing additional field |
name | string | Yes | No | Yes | The name associated with the existing additional field |
value | string | Yes | No | Yes | The value (content) for the existing additional field |
record_id | string | Yes | No | No | The record id associated with the existing additional field |
HTTP Status Code | Response Body |
---|---|
200 | { |
404 | { "message": { "error": "Resource Not Found. Additional field with id <additional_field_id> doesn't exist" } } |
403 | { "message": { "error": "Access Denied. Additional field <additional_field_id> doesn't belong to the current user <user_id>" } } |
400 | { "message": { "name": "This JSON body argument is missing at all or it's value is null" } } |
400 | {"message": { "login": "This JSON body argument is in wrong format. Correct format is IV:Data", "name": "This JSON body argument is an empty string"} } |
DELETE /additional_fields?id=example_id
Field | Type | Required | Encrypted | Description |
---|---|---|---|---|
id | string | Yes | No | The unique identifier for the additional field |
HTTP Status Code | Response Body |
---|---|
200 | { |
400 | { "message": { "error": "Missing Parameter. Additional field id is missing in URI arguments" } } |
404 | { "message": { "error": "Resource Not Found. Additional field with id <additional_field_id> doesn't exist" } } |
403 | { "message": { "error": "Access Denied. Additional field <additional_field_id> doesn't belong to the current user <user_id>" } } |
GET additional_fields?id=example_record_id
Field | Type | Required | Encrypted | Description |
---|---|---|---|---|
id | string | Yes | No | The unique identifier for the record of an additional field |
[
{
"id": "example_id",
"name": "example_name",
"value": "example_value",
"record_id": "example_record_id"
},
{
"id": "example_id_2",
"name": "example_name_2",
"value": "example_value_2",
"record_id": "example_record_id"
}
]
HTTP Status Code | Response Body |
---|---|
400 | { "message": { "error": "Missing Parameter. Record id is missing in URI arguments" } } |
404 | { "message": { "error": "Resource Not Found. Record with id <record_id> doesn't exist" } } |
403 | { "message": { "error": "Access Denied. Record <record_id> doesn't belong to the current user <user_id>" } } |
404 | { "message": { "error": "Resource Not Found. Current user's <user_id> record <record_id> has no additional fields" } } |