Views: 2485
Last Modified: 14.06.2022

Switch conversation to specific operator

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 112 Yes Chat ID 1
USER_ID 12 Yes User ID, to which forwarding is performed. 1
LEAVE N Yes Y/N. If 'N’ is specified – chatbot will not leave this chat after forwarding and will be available until user is confirmed 1


Note: Instead of USER_ID you can indicate QUEUE_ID for witching to another open channel.

Method call and response

PHP

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

    'CHAT_ID' => 112,
    'USER_ID' => 12,
    'LEAVE' => 'N'

), $_REQUEST["auth"]);

Response example

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

Example of response on error

{
    "error": "CHAT_ID_EMPTY",
    "error_description": "No chat ID"
}

Key description:

  • error – error code
  • error_description – error brief description

Possible error codes

Code Description
CHAT_ID_EMPTY No chat ID.
USER_ID_EMPTY No user ID, to which conversation must be forwarded.
WRONG_CHAT Incorrect user ID is specified, or this user is chatbot or extranet user.
BOT_ID_ERROR Incorrect chatbot ID.




Courses developed by Bitrix24