api/v2/listValue
ListValue model represents directory values in the elDoc system. This REST API Reference describes available methods for the ListValue objects.
API overview
Method | API endpoint |
|---|---|
| Get list values | GET api/v2/listValue |
| Get list value | GET api/v2/listValue/{id} |
| Create or update list value | POST api/v2/listValue |
Get list values
GET api/v2/listValue
Retrieves 1st-level list values (as shown on the Directories management page). When request is executed with _id_kf query parameter - list values returned only for the respective Directory.
Request:
GET https://eldoc.domain.com/api/v2/listValue
| Param | Type | Description | Sample values (comma separated) |
|---|---|---|---|
| Query param | Full id (24 hex-character) of the Directory for which list values are to be retrieved. In case parameter not set - response contains only the 1ft level list values | 59e0c3e47b827239691c670b, 59e0c3e47b827239691c670a |
Response:
Content-Type: application/json
[
{
"_id": "59b8055c60e9ab2c6e7b777f",
"_meta": {
"_created": "2015-12-22T12:57:11Z",
"_lastmodified": "2019-02-21T02:48:45Z",
"_rev": 1
},
"author": "api-83000772-020d-43f1-9f51-9ddd08c0e5e8",
"status": 0,
"type": 2,
"value": {
"en": "CRM: Company type",
"ru": "CRM: Тип организации",
"uk": "CRM: Тип организации"
}
},
{
"_id": "59f450f761a57f370cf8db1f",
"_meta": {
"_created": "2017-10-28T09:41:52Z",
"_lastmodified": "2022-01-07T08:59:14Z",
"_rev": 3
},
"author": "api-83000772-020d-43f1-9f51-9ddd08c0e5e8",
"status": 0,
"type": 0,
"value": {
"en": "Contract type",
"ru": "Тип договора",
"uk": "Тип договору"
}
}
]
Get list value
GET api/v2/listValue/{id}
Retrieves list value by id
Request:
GET https://eldoc.domain.com/api/v2/listValue/{id}
| Param | Type | Description | Sample values (comma separated) |
|---|---|---|---|
{id} | Path param | Full id (24 hex-character) of the list value | 59e0c3e47b827239691c6700, 59e0c3e47b827239691c6701 |
Response:
Content-Type: application/json
{
"_id": "59b8055c60e9ab2c6e7b777f",
"_meta": {
"_created": "2015-12-22T12:57:11Z",
"_lastmodified": "2019-02-21T02:48:45Z",
"_rev": 1
},
"author": "api-83000772-020d-43f1-9f51-9ddd08c0e5e8",
"status": 0,
"type": 2,
"value": {
"en": "CRM: Company type",
"ru": "CRM: Тип организации",
"uk": "CRM: Тип организации"
}
}
Create or update list value
POST api/v2/listValue
Creates or updates list value (Directory) record in the system.
Validation rules are applied to the submitted request value. In case of response codes different to 200/201 check the X-Error response header for details.
Access rights requirement
Method requires [elAdminDocRW] role
Request:
POST https://eldoc.domain.com/api/v2/listValue
{
"_id_kf": "59b8055c60e9ab2c6e7b7771",
"_id_ext": "11",
"status": 10
}
Response:
Content-Type: application/json
{
"_id": "59b8055c60e9ab2c6e7b8907",
"_id_kf": "59b8055c60e9ab2c6e7b7771",
"_id_ext": "11",
"_meta": {
"_created": "2015-12-22T12:57:11Z",
"_lastmodified": "2022-02-21T02:48:45Z",
"_rev": 5
},
"author": "api-83000772-020d-43f1-9f51-9ddd08c0e5e8",
"status": 10,
"value": {
"en": "Banks"
}
}
Last modified: April 28, 2023