MyChat Integration API: MCIAPI_CS_SendChannelMessage, send a message to a conference
Send a message to a conference on behalf of any user name. This user must be online and in this conference.
If you need to sen a message but you do not know which account is present in a conference, use a built-in bot Elisa (UIN=0).
Syntax
{
"cmd" : "0004",
"ServerKey" : "iddqd",
"APIStype" : "mydata",
"UserFrom" : "0",
"UID" : 12,
"Msg" : "bla-bla-bla"
}
Parameters
Parameter |
Type |
Value |
cmd |
string |
"0004", the number of the command MCIAPI_CS_SendChannelMessage; |
ServerKey |
string |
Integration API key, can be set in the server's settings; |
APIStype |
string |
integration type. You can set any string; |
context |
string |
optional parameter, any text that returns in a response command; |
UserFrom |
string |
user-sender. "0" by default. You can set UIN, email, or a user nickname. A user must be a conference member; |
UID |
integer |
unique numeric identifier of a text conference (UID). You can check it in the list of active conferences on the server; |
Msg |
string |
message text. |
MsgType |
integer |
message type, unnecessary parameter. If a message type is not a simple text, then JSON object or multi-line text will be in Msg. |
Work result
{
"сmd" : "0004",
"UINFrom" : 0,
"UID" : 12
}
Field |
Тип |
Value |
cmd |
string |
HEX number of a command that was successfully executed; |
context |
string |
any text sent to the server in a query command; |
UINFrom |
integer |
unique identifier of a message sender (UIN) that is determined by the server by the incoming parameter UserFrom; |
UID |
integer |
unique identifier of a text conference to which a message was successfully sent. |
Possible errors
#2, MCIAPI_Error_WrongSenderUser
#5, MCIAPI_Error_WrongIntegrationKey
#7, MCIAPI_Error_UserNotInChannel
#12, MCIAPI_Error_WrongDomainUserSender