Contact groups (contactgroups)
Requests
| HTTP verb | Endpoint | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creating a new contact group
Request
Field description: contactgroup entity
POST /rest/v1/addressbook/contactgroups HTTP/1.1
Content-Type: application/json; charset=utf-8
contactgroup entity
Response
Field description: contactgroup entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "67f1f2df-016c-dc6b-5202-50e54938780c",
"code": "101",
"name": "group number 101",
"shortname": "G.101",
"opts": {
"title": "",
"comment": "",
"abonents": [ 1, 5 ],
"abonentcount": 2,
"priority": 101
},
"ext": {
"ct": "2019-08-29T08:08:32.60Z",
"lwt": "2019-08-29T08:08:32.60Z"
}
}
Getting the list of contact groups
Request
| Name | Type | Description |
|---|---|---|
|
|
Filter by field values. |
|
|
List of fields to output. Available fields for output: id, code, name, shortname, opts.abonentcount, opts.priority, ext.lwt, ext.ct. |
|
|
Offset in the list of resources to output. |
|
|
Maximum number of resources in the list. |
|
|
Sorting order of resources in the list. |
|
|
Transformation of composite fields to flat form. |
GET /rest/v1/addressbook/contactgroups?offset=0&limit=2 HTTP/1.1
Response
Field description: contactgroup entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"id": "94cfb284-016c-dc6a-6823-50e54938780c",
"code": "007",
"name": "group number 007",
"shortname": "G.007",
"opts": {
"abonentcount": 3,
"priority": 1000
},
"ext": {
"ct": "2019-08-29T08:07:36.24Z",
"lwt": "2019-08-29T08:07:36.24Z"
}
},
{
"id": "67f1f2df-016c-dc6b-5202-50e54938780c",
"code": "101",
"name": "group number 101",
"shortname": "G.101",
"opts": {
"abonentcount": 2,
"priority": 101
},
"ext": {
"ct": "2019-08-29T08:08:32.60Z",
"lwt": "2019-08-29T08:08:32.60Z"
}
}
]
Getting contact group data
Request
| Name | Type | Description |
|---|---|---|
|
|
List of fields to output. |
|
|
Transformation of composite fields to flat form. |
GET /rest/v1/addressbook/contactgroups/67f1f2df-016c-dc6b-5202-50e54938780c HTTP/1.1
Response
Field description: contactgroup entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "67f1f2df-016c-dc6b-5202-50e54938780c",
"code": "101",
"name": "group number 101",
"shortname": "G.101",
"opts": {
"title": "",
"comment": "",
"abonents": [ 1, 5 ],
"abonentcount": 2,
"priority": 101
},
"ext": {
"ct": "2019-08-29T08:08:32.60Z",
"lwt": "2019-08-29T08:08:32.60Z"
}
}
Modifying contact group data
Fields prohibited for modification: id
Specifics
-
When the contact composition changes, the link on the contact side changes automatically.
-
When the contact group code changes, associations between contacts and the contact group are automatically rebuilt.
-
If the values of the name and shortname fields match before the change, then when name changes without shortname changing, the latter is automatically filled with content identical to name.
Request
Field description: contactgroup entity
PATCH /rest/v1/addressbook/contactgroups/67f1f2df-016c-dc6b-5202-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8
contactgroup entity
Response
Field description: contactgroup entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "67f1f2df-016c-dc6b-5202-50e54938780c",
"code": "101",
"name": "group number 101",
"shortname": "G.101",
"opts": {
"title": "",
"comment": "",
"abonents": [ 1, 5, 15, 27 ],
"abonentcount": 4,
"priority": 98
},
"ext": {
"ct": "2019-08-29T08:08:32.60Z",
"lwt": "2019-09-06T16:22:07.54Z"
}
}
Deleting a contact group
Searching for a contact group identifier
Searches for a resource by the specified key and returns the identifier(s) for building the endpoint.
Key fields for search: id, code