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 valuesGET api/v2/listValue
Get list valueGET api/v2/listValue/{id}
Create or update list valuePOST api/v2/listValue



Get list values

URL & Method & Description

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:

Request (sample)
GET https://eldoc.domain.com/api/v2/listValue
ParamTypeDescriptionSample values (comma separated)

{_id_kf}

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:

Response headers
Content-Type: application/json
Response body (sample)
[
    {
        "_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

URL & Method & Description

GET api/v2/listValue/{id}

Retrieves list value by id

Request:

Request (sample)
GET https://eldoc.domain.com/api/v2/listValue/{id}
ParamTypeDescriptionSample values (comma separated)
{id}Path paramFull id (24 hex-character) of the list value 59e0c3e47b827239691c6700, 59e0c3e47b827239691c6701

Response:

Response headers
Content-Type: application/json
Response body (sample)
{
  "_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

URL & Method & Description

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:

Request (sample)
POST https://eldoc.domain.com/api/v2/listValue
Request body (sample)
{
  "_id_kf": "59b8055c60e9ab2c6e7b7771",
  "_id_ext": "11",
  "status": 10
}

Response:

Response headers
Content-Type: application/json
Response body (sample)
{
  "_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"
  } 
}