Контакты (contacts)
Запросы
HTTP verb | Endpoint | Описание |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Создание нового контакта
Запрос
Описание полей: contact entity
POST /rest/v1/addressbook/contacts HTTP/1.1
Content-Type: application/json; charset=utf-8
contact entity
Ответ
Описание полей: contact entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "ae425147-016c-d818-82d0-50e54938780c",
"autokey": 1,
"displayname": "Михаил Сидоров",
"department": "IT",
"jobtitle": "engineer",
"number": "11",
"numlocal": "411",
"numpublic": "84950000000",
"mobile": "8987000000",
"mobile2": "",
"mobile3": "",
"roomnum": "2",
"roomnum2": "",
"roomnum3": "",
"email": "",
"email2": "",
"email3": "",
"photo": "",
"opts": {
"title": "",
"comment": "",
"groups": [],
"priority": null
},
"ext": {
"ct": "2019-08-28T11:59:40.75Z",
"lwt": "2019-08-28T11:59:40.75Z"
}
}
Получение списка контактов
Запрос
Имя | Тип | Описание |
---|---|---|
|
|
Фильтр по значениям полей. |
|
|
Список полей для вывода. Доступные поля для выдачи: id, autokey, displayname, department, jobtitle, number, email, opts.groups, opts.priority, ext.lwt, ext.ct. |
|
|
Смещение в списке ресурсов, подлежащих выдаче. |
|
|
Максимальное количество ресурсов в списке. |
|
|
Порядок сортировки ресурсов в списке. |
|
|
Преобразование в плоский вид составных полей. |
GET /rest/v1/addressbook/contacts?offset=0&limit=2 HTTP/1.1
Ответ
Описание полей: contact entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"id": "ae425147-016c-d818-82d0-50e54938780c",
"autokey": 1,
"displayname": "Михаил Сидоров",
"department": "IT",
"jobtitle": "engineer",
"number": "11",
"email": "m.sidorov@company.com",
"opts": {
"groups": [
"engineers"
],
"priority": 100
},
"ext": {
"ct": "2019-08-28T11:59:40.75Z",
"lwt": "2019-08-29T07:57:58.40Z"
}
},
{
"id": "26d569b2-016c-d818-9e97-50e54938780c",
"autokey": 2,
"displayname": "Семен Петров",
"department": "IT",
"jobtitle": "engineer",
"number": "12",
"email": "s.petrov@company.com",
"opts": {
"groups": [],
"priority": null
},
"ext": {
"ct": "2019-08-28T11:59:47.86Z",
"lwt": "2019-08-29T07:57:47.50Z"
}
}
]
Получение данных контакта
Запрос
Имя | Тип | Описание |
---|---|---|
|
|
Список полей для вывода. |
|
|
Преобразование в плоский вид составных полей. |
GET /rest/v1/addressbook/contacts/ae425147-016c-d818-82d0-50e54938780c HTTP/1.1
Ответ
Описание полей: contact entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "ae425147-016c-d818-82d0-50e54938780c",
"autokey": 1,
"displayname": "Михаил Сидоров",
"department": "IT",
"jobtitle": "engineer",
"number": "11",
"numlocal": "411",
"numpublic": "84950000000",
"mobile": "8987000000",
"mobile2": "",
"mobile3": "",
"roomnum": "2",
"roomnum2": "",
"roomnum3": "",
"email": "m.sidorov@company.com",
"email2": "",
"email3": "",
"photo": "",
"opts": {
"title": "",
"comment": "",
"groups": [
"engineers"
],
"priority": 100
},
"ext": {
"ct": "2019-08-28T11:59:40.75Z",
"lwt": "2019-08-29T07:57:58.40Z"
}
}
Изменение данных контакта
Поля запрещенные для изменения: id, autokey
Запрос
Описание полей: contact entity
PATCH /rest/v1/addressbook/contacts/ae425147-016c-d818-82d0-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8
contact entity
Ответ
Описание полей: contact entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "ae425147-016c-d818-82d0-50e54938780c",
"autokey": 1,
"displayname": "Михаил Сидоров",
"department": "IT",
"jobtitle": "engineer",
"number": "11",
"numlocal": "411",
"numpublic": "84950000000",
"mobile": "8987000000",
"mobile2": "",
"mobile3": "",
"roomnum": "2",
"roomnum2": "",
"roomnum3": "",
"email": "m.sidorov@company.com",
"email2": "",
"email3": "",
"photo": "",
"opts": {
"title": "",
"comment": "",
"groups": [
"engineers"
],
"priority": 100
},
"ext": {
"ct": "2019-08-28T11:59:40.75Z",
"lwt": "2019-08-29T07:57:58.40Z"
}
}