Загрузка данных о клиентах (JSON)
Выполняет загрузку данных о клиентах. Данные передаются как JSON в теле POST-запроса.
Пример тела запроса
--data '{
"contacts": [
{
"uniq_id": "J3QQ4-H7H2V-2HCH4-M3HK8-6M8VW",
"name": "Иванов И.",
"create_date_time": "2020-04-17 16:12:21",
"update_date_time": "2020-04-17 16:12:21",
"client_ids": [
"12345678910",
"10987654321"
],
"emails": [
"exampl1@example.com",
"example2@example.com"
],
"phones": [
"78005553535",
"73449932378"
]
},
{
"uniq_id": "ZYX4-H7H2V-2HCH4-M3HK8-6M8VW",
"name": "Петрова М.",
"create_date_time": "2020-05-17 16:13:21",
"update_date_time": "2020-05-17 16:14:21",
"client_ids": [
"11223344556"
]
}
]
}'
Request
POST
https://api-metrika.yandex.net/cdp/api/v1/counter/{counterId}/data/contacts/json
Path parameters
|
Name |
Description |
|
counterId |
Type: integer Идентификатор счетчика, для которого вы хотите загрузить контакты. |
Query parameters
|
Name |
Description |
|
merge_mode |
Type: string Режим сохранения данных. При любом из значений передавайте все обязательные поля — даже те, которые не меняются.
Example: |
Body
application/json
{
"contacts": [
{
"attribute_values": [
{}
],
"uniq_id": "example",
"name": "example",
"birth_date": "2025-01-01",
"create_date_time": "2025-01-01T00:00:00Z",
"update_date_time": "2025-01-01T00:00:00Z",
"client_ids": [
0
],
"user_ids": [
"example"
],
"emails": [
"example"
],
"phones": [
"example"
],
"emails_md5": [
"example"
],
"phones_md5": [
"example"
],
"company_uniq_id": "example",
"user_comment": "example"
}
]
}
|
Name |
Description |
|
contacts |
Type: ContactRow[] Min items: Example
|
ContactRow
Список клиентов.
|
Name |
Description |
||
|
uniq_id |
Type: string Идентификатор клиента. Min length: Example: |
||
|
attribute_values |
Type: object[]
Пользовательские атрибуты. Example
|
||
|
birth_date |
Type: string<date> Дата рождения клиента. Example: |
||
|
client_ids |
Type: integer[] Min items: Max items: Unique items: Example
|
||
|
create_date_time |
Type: string<date-time> Дата и время создания контакта в часовом поясе счетчика. Подробно. Example: |
||
|
emails |
Type: string[] Min items: Max items: Unique items: Example
|
||
|
emails_md5 |
Type: string[] Min items: Max items: Unique items: Example
|
||
|
name |
Type: string Название клиента. Если вы передаете фамилию, имя и отчество, строка будет сокращена до вида Example: |
||
|
phones |
Type: string[] Min items: Max items: Unique items: Example
|
||
|
phones_md5 |
Type: string[] Min items: Max items: Unique items: Example
|
||
|
update_date_time |
Type: string<date-time> Дата и время обновления контакта в часовом поясе счетчика. Подробно. Example: |
||
|
user_comment |
Type: string Комментарий к клиенту. Min length: Max length: Example: |
Example
{
"attribute_values": [
{}
],
"uniq_id": "example",
"name": "example",
"birth_date": "2025-01-01",
"create_date_time": "2025-01-01T00:00:00Z",
"update_date_time": "2025-01-01T00:00:00Z",
"client_ids": [
0
],
"emails": [
"example"
],
"phones": [
"example"
],
"emails_md5": [
"example"
],
"phones_md5": [
"example"
],
"user_comment": "example"
}
Responses
200 OK
OK
Body
application/json
{
"uploading": {
"uploading_id": "example",
"datetime": "2025-01-01T00:00:00Z",
"api_validation_status": "example",
"elements_count": 0,
"entity_type": "example",
"entity_subtype": "example",
"uploading_format": "example",
"uploading_source": "example",
"api_validation_errors": [
"example"
],
"uploading_title": "example"
}
}
|
Name |
Description |
|
uploading |
Type: UploadingMetaExternal Информация о загрузке Example
|
UploadingMetaExternal
Информация о загрузке
|
Name |
Description |
|
api_validation_status |
Type: string Статус валидации загрузки:
Example: |
|
datetime |
Type: string<date-time> Время загрузки. Example: |
|
elements_count |
Type: integer Количество элементов в загрузке. |
|
entity_type |
Type: string Тип сущности:
Example: |
|
uploading_format |
Type: string Формат загрузки. Возможные значения:
Example: |
|
uploading_id |
Type: string Идентификатор загрузки. Example: |
|
uploading_source |
Type: string Источник загрузки. Возможные значения: Example: |
Example
{
"uploading_id": "example",
"datetime": "2025-01-01T00:00:00Z",
"api_validation_status": "example",
"elements_count": 0,
"entity_type": "example",
"uploading_format": "example",
"uploading_source": "example"
}
No longer supported, please use an alternative and newer version.