Получить контакты
Получите список существующих контактов в Контактной книге вашего аккаунта с подробной информацией о каждом из них. Метод также позволяет получить контакты из определенных списков, указанных в параметрах запроса.
Чтобы получить список контактов, выполните запрос по этому URL-адресу:
GET http://one-api.notificore.ru/api/contacts
Request parameters
Parameter | Required | Type | Description |
---|---|---|---|
page[limit] | No | integer | The number of entries in the response. The value range for the parameter: min – 15, max – 500. The default is 30. |
per[offset] | No | integer | Get contacts starting from the offset. |
groups | No | array | Index of IDs of the lists for which you want to display contacts. |
Response parameters
Parameter | Type | Description |
---|---|---|
id | integer | Contact ID in the personal account, which is generated automatically when a contact is added to the Contact Book. |
phone | integer | Contact’s phone number |
fields | array | contains embedded custom fields data: |
- id: Custom field ID | ||
- value: Custom field data | ||
created_at | datetime | Date when the contact was created in the system ― set by the system automatically when a contact is added to the Contact Book. Display format ― Y-m-d H:i:s |
groups | array | contains embedded data of the list where the contact is added |
- id: ID of the list (generated automatically when creating a contact list) where the contact is added | ||
- name: Name of the list where the contact was added | ||
- description: Description of the list where the contact is added | ||
- default: Specifies whether the contact list is a default one | ||
- created_at: Creation date of the list where the contact was added. Display format ― Y-m-d H:i:s | ||
items | integer | The number of numbers in the contact list. |
stop_list_count | integer | The number of numbers from the list that are in the stop list of SMS and Viber. |
hlr_status | string | Status of the contact phone number verification against the HLR database. Possible values: sent, absent, active, unknown, failed. |
hlr_last_check | datetime | Date and time when the contact’s phone number was last verified against the HLR database. Display Format ― Y-m-d H:i:s |
Если запрос успешен, вы получите ответ:
{ "data": [ { "id": 1, "phone": 33601148802, "fields": { "additionalProp1": "string", "additionalProp2": "string", "additionalProp3": "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", "items": 11, "stop_list_count": 0 } ], "hlr_status": "string", "hlr_last_check": "2022-04-28 14:21:16" } ], "total": 0 }