# Протокол

## Оглавление

- [keyapis/omnichat/v1/keyapis_omnichat_credentials_v1.proto](#keyapis_omnichat_v1_keyapis_omnichat_credentials_v1-proto)
    - [CredentialsService](#keyapis-omnichat-v1-CredentialsService)
  
    - [ClientMetadata](#keyapis-omnichat-v1-ClientMetadata)
    - [Credentials](#keyapis-omnichat-v1-Credentials)
    - [PostCredentialsRequest](#keyapis-omnichat-v1-PostCredentialsRequest)
    - [PostCredentialsResponse](#keyapis-omnichat-v1-PostCredentialsResponse)
    - [PostCredentialsResponse.Error](#keyapis-omnichat-v1-PostCredentialsResponse-Error)
    - [PostCredentialsResponse.Error.AppNameUnsupported](#keyapis-omnichat-v1-PostCredentialsResponse-Error-AppNameUnsupported)
    - [ValidationError](#keyapis-omnichat-v1-ValidationError)
  


## [Схема классов](/svg/protos/key/keyapis/omnichat/v1/keyapis_omnichat_credentials_v1.proto.svg)
<a href="/svg/protos/key/keyapis/omnichat/v1/keyapis_omnichat_credentials_v1.proto.svg"><img src="/svg/protos/key/keyapis/omnichat/v1/keyapis_omnichat_credentials_v1.proto.svg" alt="/svg/protos/key/keyapis/omnichat/v1/keyapis_omnichat_credentials_v1.proto.svg" style="height:100%;"></a>




<a name="keyapis_omnichat_v1_keyapis_omnichat_credentials_v1-proto"></a>

## [keyapis/omnichat/v1/keyapis_omnichat_credentials_v1.proto](/protos/key/keyapis/omnichat/v1/keyapis_omnichat_credentials_v1.proto)
Сервис реализует функционал получения реквизитов для авторизации в омничате


<a name="keyapis-omnichat-v1-CredentialsService"></a>

### CredentialsService
 Сервис для авторизации в омничате

| Название метода | Описание | Тип запроса | Тип ответа |
| --------------- | -------- | ----------- | -----------|
| <a id="keyapis-omnichat-v1-PostCredentials"></a> [PostCredentials](#keyapis-omnichat-v1-PostCredentials) | Метод получение реквизитов для авторизации в Omnichat. Метод доступен для: master, employee, owner | [keyapis.omnichat.v1.PostCredentialsRequest](#keyapis-omnichat-v1-PostCredentialsRequest) | [keyapis.omnichat.v1.PostCredentialsResponse](#keyapis-omnichat-v1-PostCredentialsResponse) |

 <!-- end services -->


<a name="keyapis-omnichat-v1-ClientMetadata"></a>


### [ClientMetadata](#keyapis-omnichat-v1-ClientMetadata)
 Метаданные клиента


| Поле | Описание | Тип | Признак |
| ---- | -------- | --- | ------- |
| <a id="keyapis-omnichat-v1-ClientMetadata-app_version"></a> [app_version](#keyapis-omnichat-v1-ClientMetadata-app_version) | Версия приложения. # Диапазон: 1..128 |    [google.protobuf.StringValue](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) | <nil>|
| <a id="keyapis-omnichat-v1-ClientMetadata-os_version"></a> [os_version](#keyapis-omnichat-v1-ClientMetadata-os_version) | Версия операционной системы. # Диапазон: 1..128 |    [google.protobuf.StringValue](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) | <nil>|
| <a id="keyapis-omnichat-v1-ClientMetadata-device_model"></a> [device_model](#keyapis-omnichat-v1-ClientMetadata-device_model) | Модель устройства. # Диапазон: 1..128 |    [google.protobuf.StringValue](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) | <nil>|
| <a id="keyapis-omnichat-v1-ClientMetadata-app_name"></a> [app_name](#keyapis-omnichat-v1-ClientMetadata-app_name) | Название приложения. Для разных приложений мы можем использовать разные tenantId и channel_id, сопоставление хранится в конфиге сервиса |    [string](#scalar-types) | REQUIRED|






<a name="keyapis-omnichat-v1-Credentials"></a>


### [Credentials](#keyapis-omnichat-v1-Credentials)
 Реквезиты для авторизации в omnichat


| Поле | Описание | Тип | Признак |
| ---- | -------- | --- | ------- |
| <a id="keyapis-omnichat-v1-Credentials-payload"></a> [payload](#keyapis-omnichat-v1-Credentials-payload) | Закодированные в base64 клиентские данные. Состав: appVersion, os, deviceModel, tenantId, login, phone, email, group_id, address, лицевые счета |    [string](#scalar-types) | REQUIRED|
| <a id="keyapis-omnichat-v1-Credentials-hash"></a> [hash](#keyapis-omnichat-v1-Credentials-hash) | HMAC-подпись от payload (клиентских данных) |    [string](#scalar-types) | REQUIRED|
| <a id="keyapis-omnichat-v1-Credentials-channel_id"></a> [channel_id](#keyapis-omnichat-v1-Credentials-channel_id) | Идентификатор канала в omnichat. Определяется исходя из типа приложения |    [int32](#scalar-types) | REQUIRED|






<a name="keyapis-omnichat-v1-PostCredentialsRequest"></a>


### [PostCredentialsRequest](#keyapis-omnichat-v1-PostCredentialsRequest)
 Запрос реквезитов для авторизации в Omnichat


| Поле | Описание | Тип | Признак |
| ---- | -------- | --- | ------- |
| <a id="keyapis-omnichat-v1-PostCredentialsRequest-client_metadata"></a> [client_metadata](#keyapis-omnichat-v1-PostCredentialsRequest-client_metadata) | Метаданные клиента |    [keyapis.omnichat.v1.ClientMetadata](#keyapis-omnichat-v1-ClientMetadata) | REQUIRED|






<a name="keyapis-omnichat-v1-PostCredentialsResponse"></a>


### [PostCredentialsResponse](#keyapis-omnichat-v1-PostCredentialsResponse)
 Ответ на запрос реквезитов для авторизации в Omnichat


| Поле | Описание | Тип | Признак |
| ---- | -------- | --- | ------- |
| <a id="keyapis-omnichat-v1-PostCredentialsResponse-data"></a> [data](#keyapis-omnichat-v1-PostCredentialsResponse-data) | Реквизиты |  optional  [keyapis.omnichat.v1.Credentials](#keyapis-omnichat-v1-Credentials) | <nil>|
| <a id="keyapis-omnichat-v1-PostCredentialsResponse-error"></a> [error](#keyapis-omnichat-v1-PostCredentialsResponse-error) | Ошибка |  optional  [keyapis.omnichat.v1.PostCredentialsResponse.Error](#keyapis-omnichat-v1-PostCredentialsResponse-Error) | <nil>|






<a name="keyapis-omnichat-v1-PostCredentialsResponse-Error"></a>


### [PostCredentialsResponse.Error](#keyapis-omnichat-v1-PostCredentialsResponse-Error)
 Ошибка запроса получения хешированной информации о пользователе


| Поле | Описание | Тип | Признак |
| ---- | -------- | --- | ------- |
| <a id="keyapis-omnichat-v1-PostCredentialsResponse-Error-validation"></a> [validation](#keyapis-omnichat-v1-PostCredentialsResponse-Error-validation) | Ошибка валидации |  optional  [keyapis.omnichat.v1.ValidationError](#keyapis-omnichat-v1-ValidationError) | <nil>|
| <a id="keyapis-omnichat-v1-PostCredentialsResponse-Error-app_name_unsupported"></a> [app_name_unsupported](#keyapis-omnichat-v1-PostCredentialsResponse-Error-app_name_unsupported) | Переданное название приложения не поддерживается |  optional  [keyapis.omnichat.v1.PostCredentialsResponse.Error.AppNameUnsupported](#keyapis-omnichat-v1-PostCredentialsResponse-Error-AppNameUnsupported) | <nil>|






<a name="keyapis-omnichat-v1-PostCredentialsResponse-Error-AppNameUnsupported"></a>


### [PostCredentialsResponse.Error.AppNameUnsupported](#keyapis-omnichat-v1-PostCredentialsResponse-Error-AppNameUnsupported)
 Переданное название приложения не поддерживается






<a name="keyapis-omnichat-v1-ValidationError"></a>


### [ValidationError](#keyapis-omnichat-v1-ValidationError)
 Ошибки валидации.
Эти проверки выполняются до обращения в базу данных


| Поле | Описание | Тип | Признак |
| ---- | -------- | --- | ------- |
| <a id="keyapis-omnichat-v1-ValidationError-path"></a> [path](#keyapis-omnichat-v1-ValidationError-path) | Путь к полю в формате наименования прото |    [string](#scalar-types) | REQUIRED|
| <a id="keyapis-omnichat-v1-ValidationError-message"></a> [message](#keyapis-omnichat-v1-ValidationError-message) | Валидационное сообщение |    [string](#scalar-types) | REQUIRED|





 <!-- end messages -->

 <!-- end enums -->

 <!-- end HasExtensions -->



## Скалярные типы значений
<a id="scalar-types"></a>

| .proto Type | Примечание | Python | Go | Ruby | C# | C++ | Java | PHP |
| ----------- | ---------- | ------ | -- | ---- | -- | --- | ---- | --- |
| [double](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) |  | float | float64 | Float | double | double | double | float |
| [float](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) |  | float | float32 | Float | float | float | float | float |
| [int32](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int | int32 | Bignum or Fixnum (as required) | int | int32 | int | integer |
| [int64](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int/long | int64 | Bignum | long | int64 | long | integer/string |
| [uint32](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) | Uses variable-length encoding. | int/long | uint32 | Bignum or Fixnum (as required) | uint | uint32 | int | integer |
| [uint64](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) | Uses variable-length encoding. | int/long | uint64 | Bignum or Fixnum (as required) | ulong | uint64 | long | integer/string |
| [sint32](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int | int32 | Bignum or Fixnum (as required) | int | int32 | int | integer |
| [sint64](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int/long | int64 | Bignum | long | int64 | long | integer/string |
| [fixed32](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | int | uint32 | Bignum or Fixnum (as required) | uint | uint32 | int | integer |
| [fixed64](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | int/long | uint64 | Bignum | ulong | uint64 | long | integer/string |
| [sfixed32](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) | Always four bytes. | int | int32 | Bignum or Fixnum (as required) | int | int32 | int | integer |
| [sfixed64](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) | Always eight bytes. | int/long | int64 | Bignum | long | int64 | long | integer/string |
| [bool](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) |  | boolean | bool | TrueClass/FalseClass | bool | bool | boolean | boolean |
| [string](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) | A string must always contain UTF-8 encoded or 7-bit ASCII text. | str/unicode | string | String (UTF-8) | string | string | String | string |
| [bytes](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf/) | May contain any arbitrary sequence of bytes. | str | []byte | String (ASCII-8BIT) | ByteString | string | ByteString | string |

