POST api/bot/Message

Отправка сообщения ботом для заданного адресата

Request Information

URI Parameters

None.

Body Parameters

MessageRequest
NameDescriptionTypeAdditional information
ApiURL

Адрес апи

string

None.

MessageId

Идентификатор сообщения, по которому нужно получить данные для отправки

integer

None.

Channel

Канал отправки сообщения (Доступные значения: telegram, viber, whatsapp, vk)

string

None.

To

Адресат сообщения

string

None.

BotToken

Идентификатор бота

string

None.

GetCommands

Признак, запрашивать команды сразу после сообщения или нет

boolean

None.

EventType

Тип события, по которому отправляется сообщение

string

None.

Operator

Идентификатор оператора программы лояльности

integer

None.

Token

Токен пользователя, который инициирует данный запрос

integer

None.

SiteCode

Уникальный код виджета по продаже подарочных сертификатов, который инициирует запрос

string

None.

Request Formats

application/json, text/json

Sample:
{
  "ApiURL": "sample string 1",
  "MessageId": 2,
  "Channel": "sample string 3",
  "To": "sample string 4",
  "BotToken": "sample string 5",
  "GetCommands": true,
  "EventType": "sample string 7",
  "Operator": 1,
  "Token": 1,
  "SiteCode": "sample string 8"
}

application/xml, text/xml

Sample:
<MessageRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/LCManagerPartner.Implementation.Request">
  <Operator xmlns="http://schemas.datacontract.org/2004/07/LCManagerPartner.Implementation.Abstractions">1</Operator>
  <SiteCode xmlns="http://schemas.datacontract.org/2004/07/LCManagerPartner.Implementation.Abstractions">sample string 8</SiteCode>
  <Token xmlns="http://schemas.datacontract.org/2004/07/LCManagerPartner.Implementation.Abstractions">1</Token>
  <ApiURL>sample string 1</ApiURL>
  <BotToken>sample string 5</BotToken>
  <Channel>sample string 3</Channel>
  <EventType>sample string 7</EventType>
  <GetCommands>true</GetCommands>
  <MessageId>2</MessageId>
  <To>sample string 4</To>
</MessageRequest>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

MessageResponse
NameDescriptionTypeAdditional information
MessageId

Идентификатор отправленного сообщения

integer

None.

ErrorCode

Код ошибки

integer

None.

Message

Сообщение об ошибке

string

None.

Response Formats

application/json, text/json

Sample:
{
  "MessageId": 1,
  "ErrorCode": 2,
  "Message": "sample string 3"
}

application/xml, text/xml

Sample:
<MessageResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/LCManagerPartner.Implementation.Response">
  <ErrorCode xmlns="http://schemas.datacontract.org/2004/07/LCManagerPartner.Implementation.Abstractions">2</ErrorCode>
  <Message xmlns="http://schemas.datacontract.org/2004/07/LCManagerPartner.Implementation.Abstractions">sample string 3</Message>
  <MessageId>1</MessageId>
</MessageResponse>