Поиск контакта
Метод для поиска контактов в Книге контактов.
В поиске можно использовать операции like, =, >, >=, <, <=.
Поиск возможен по следующим полям:
- id: =, >, >=, <, <=
- phone: like, =
- {field_id}:
- для поля с типом "Текст": like, =
- для поля с типом "Число": =, >, >=, <, <=
- для поля с типом "Дата": =, >, >=, <, <=
Чтобы выполнить поиск контактов, отправьте запрос по этому URL:
GET http://one-api.notificore.ru/api/contacts/search
Request parameters
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
page[offset] | No | int | 0 | Get contacts starting from offset |
page[limit] | No | int | 50 | Number of contacts in response |
sort | No | string | id | Sort by conditions: id, phone |
way | No | string | asc | Sorting options: asc, desc |
search[operation] | No | string | = | Operator for finding values: like, =, >, >=, <, <= |
search[field] | No | string | no | Field for search. Possible values: id, phone, group_id, date, {field_id} |
search[value] | No | string | no | Value for search |
Response parameters
Parameter | Type | Description |
---|---|---|
id | integer | Contact ID |
phone | integer | Contact phone number |
fields | Contains nested custom field parameters | |
created_at | datetime | Contact creation date – set automatically by the Notificore system when adding a contact to the Contact Book. Format ISO 8601 yyyy-mm-dd hh:mm:ss |
groups | Contains nested parameters of the list to which the contact is added | |
hlr_status | string | Status of checking the contact’s phone number in HLR. Possible values: barred, absent, active, unknown, failed. |
hlr_last_check | datetime | Date and time when the contact’s phone number was last checked in HLR. Format ISO 8601 yyyy-mm-dd hh:mm:ss |
Если запрос успешен, вы получите ответ:
{ "data": [ { "id": 1, "phone": 33601148802, "fields": [ { "code": 0, "text": "string" } ], "created_at": "2022-04-28 14:21:16", "groups": [ { "id": 1, "name": "string", "description": "string", "default": 0, "created_at": "2022-04-28 14:21:16" } ], "hlr_status": "string", "hlr_last_check": "2022-04-28 14:21:16" } ], "meta": { "page": { "total": 1, "limit": 50, "offset": 0 }, "search": { "field": 0, "operation": "like", "value": "string" } } }