Добавить контакт
Добавляет новый внешний контакт.
Request
POST
https://api360.yandex.net/directory/v1/org/{orgId}/external_contacts
Path parameters
|
Name |
Description |
|
orgId |
Type: integer Идентификатор организации. |
Body
application/json
{
"firstName": "example",
"lastName": "example",
"middleName": "example",
"title": "example",
"company": "example",
"department": "example",
"address": "example",
"externalId": "example",
"emails": [
{
"email": "example",
"type": "example",
"main": true
}
],
"phones": [
{
"phone": "example",
"type": "example",
"main": true
}
]
}
|
Name |
Description |
|
emails |
Type: v1ExternalContactEmail[] Электронные адреса. В массиве должен быть хотя бы один элемент. Example
|
|
firstName |
Type: string Имя. Example: |
|
lastName |
Type: string Фамилия. Example: |
|
address |
Type: string Почтовый адрес. Example: |
|
company |
Type: string Компания. Example: |
|
department |
Type: string Подразделение. Example: |
|
externalId |
Type: string Произвольный внешний идентификатор. Example: |
|
middleName |
Type: string Отчество. Example: |
|
phones |
Type: v1ExternalContactPhone[] Телефоны. Example
|
|
title |
Type: string Должность. Example: |
v1ExternalContactEmail
|
Name |
Description |
|
|
Type: string Электронный адрес. Example: |
|
main |
Type: boolean Признак основного электронного адреса:
|
|
type |
Type: string Тип электронного адреса. Возможные значения:
Example: |
Example
{
"email": "example",
"type": "example",
"main": true
}
v1ExternalContactPhone
|
Name |
Description |
|
main |
Type: boolean Признак основного телефона:
|
|
phone |
Type: string Телефон. Example: |
|
type |
Type: string Тип телефона. Возможные значения:
Example: |
Example
{
"phone": "example",
"type": "example",
"main": true
}
Responses
200 OK
Запрос успешно выполнен.
Body
application/json
{
"id": "example"
}
|
Name |
Description |
|
id |
Type: string Идентификатор внешнего контакта. Example: |
400 Bad Request
Некорректный запрос.
Body
application/json
{
"code": 0,
"message": "example",
"details": [
{
"@type": "example"
}
]
}
|
Name |
Description |
|
code |
Type: integer Код ошибки. |
|
details |
Type: protobufAny[] Дополнительные сведения об ошибке. Example
|
|
message |
Type: string Описание ошибки. Example: |
protobufAny
|
Name |
Description |
|
@type |
Type: string Example: |
|
[additional] |
Type: unknown Example: |
Example
{
"@type": "example"
}
401 Unauthorized
Пользователь не авторизован.
Body
application/json
{
"code": 0,
"message": "example",
"details": [
{
"@type": "example"
}
]
}
|
Name |
Description |
|
code |
Type: integer Код ошибки. |
|
details |
Type: protobufAny[] Дополнительные сведения об ошибке. Example
|
|
message |
Type: string Описание ошибки. Example: |
403 Forbidden
У пользователя или приложения нет прав на доступ к ресурсу, запрос отклонен.
Body
application/json
{
"code": 0,
"message": "example",
"details": [
{
"@type": "example"
}
]
}
|
Name |
Description |
|
code |
Type: integer Код ошибки. |
|
details |
Type: protobufAny[] Дополнительные сведения об ошибке. Example
|
|
message |
Type: string Описание ошибки. Example: |
404 Not Found
Запрашиваемый ресурс не найден.
Body
application/json
{
"code": 0,
"message": "example",
"details": [
{
"@type": "example"
}
]
}
|
Name |
Description |
|
code |
Type: integer Код ошибки. |
|
details |
Type: protobufAny[] Дополнительные сведения об ошибке. Example
|
|
message |
Type: string Описание ошибки. Example: |
500 Internal Server Error
Внутренняя ошибка сервиса. Попробуйте повторно отправить запрос через некоторое время.
Body
application/json
{
"code": 0,
"message": "example",
"details": [
{
"@type": "example"
}
]
}
|
Name |
Description |
|
code |
Type: integer Код ошибки. |
|
details |
Type: protobufAny[] Дополнительные сведения об ошибке. Example
|
|
message |
Type: string Описание ошибки. Example: |
No longer supported, please use an alternative and newer version.