Contacts (contacts)
Requests
HTTP verb | Endpoint | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creating a new contact
Request
Field Description: contact entity
POST /rest/v1/addressbook/contacts HTTP/1.1
Content-Type: application/json; charset=utf-8
contact entity
Response
Field Description: contact entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "ae425147-016c-d818-82d0-50e54938780c",
"autokey": 1,
"displayname": "John Smith",
"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"
}
}
Getting a list of contacts
Request
Name | Type | Description |
---|---|---|
|
|
Filter by field values. |
|
|
List of fields to output. Available fields for output: id, autokey, displayname, department, jobtitle, number, email, opts.groups, opts.priority, ext.lwt, ext.ct. |
|
|
Offset in the list of resources to be issued. |
|
|
The maximum number of resources in the list. |
|
|
The sort order of the resources in the list. |
|
|
Conversion to flat form of composite fields. |
GET /rest/v1/addressbook/contacts?offset=0&limit=2 HTTP/1.1
Response
Field Description: contact entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"id": "ae425147-016c-d818-82d0-50e54938780c",
"autokey": 1,
"displayname": "John Smith",
"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": "Adam White",
"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"
}
}
]
Retrieving contact data
Request
Name | Type | Description |
---|---|---|
|
|
A list of fields to output. |
|
|
Conversion to flat form of composite fields. |
GET /rest/v1/addressbook/contacts/ae425147-016c-d818-82d0-50e54938780c HTTP/1.1
Response
Field Description: contact entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "ae425147-016c-d818-82d0-50e54938780c",
"autokey": 1,
"displayname": "John Smith",
"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"
}
}
Changing contact data
Fields prohibited for modification: id, autokey
Request
Field Description: contact entity
PATCH /rest/v1/addressbook/contacts/ae425147-016c-d818-82d0-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8
contact entity
Response
Field Description: contact entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "ae425147-016c-d818-82d0-50e54938780c",
"autokey": 1,
"displayname": "John Smith",
"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"
}
}
Deleting a contact
Searching for a contact ID
Searches the resource for the specified key, returns the identifier(s) to build the endpoint.
Key fields to search for: id, autokey, number
Request
LOOKUP /rest/v1/addressbook/contacts HTTP/1.1
Content-Type: application/json; charset=utf-8
"11"
Response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
[
"ae425147-016c-d818-82d0-50e54938780c"
]
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8
{
"error_code": 1404,
"error_message": "Lookup failed"
}