Views: 2615
Last Modified: 20.11.2023

Connecting an open channel by code

Revision Get information about current API version (platform version) – 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 Req. Description Revision
CODE ab515f5d85a8b844d484f6ea75a2e494 Yes Code for searching from connector page 1


Method call and response

PHP

$result = restCommand('imopenlines.network.join', Array(

    'CODE' => 'ab515f5d85a8b844d484f6ea75a2e494'

), $_REQUEST["auth"]);

Response example

{
	"result": 42
}

Result: chatbot ID or error.

Example of response on error

{
    "error": "NOT_FOUND",
    "error_description": "Openline is not found"
}

Key description:

  • error – error code
  • error_description – error brief description

Possible error codes

Code Description
IMBOT_ERROR Imbot module is not installed
NOT_FOUND Open Channel not found
INACTIVE Open Channel presently is unavailable




Courses developed by Bitrix24