Views: 2496
Last Modified: 14.06.2022

Send automatic chat bot message

Revision You can get information about the current API version (platform version) as follows: im.revision.get : 1

Attention! To use the IMOPENLINES REST methods you need to have access permissions for imbot (Creating and managing chat bots) as well as access to the imopenlines (Open channels) scope.

Parameters

Parameter Example Required Description Revision
CHAT_ID 2 Yes Chat ID, taken by current agent 1
MESSAGE message text Yes Sent message 1
NAME WELCOME Yes Message type: WELCOME - greetings message, DEFAULT - standard message. Empty be default 1


Method call and response

PHP

$result = restCommand('imopenlines.bot.session.message.send', Array(

	'CHAT_ID' => 2,
	'MESSAGE' => 'message text',
	'NAME' => 'WELCOME'
), $_REQUEST["auth"]);

Response example

{
	"result": true
}
Result: true or error.




Courses developed by Bitrix24