Get Information About the Operator's Dialog imopenlines.dialog.get

Scope: imopenlines

Who can execute the method: any user with access permission to the dialog

The method imopenlines.dialog.get returns data from the open line chat. You only need to provide one of the parameters.

Method Parameters

Required parameters are marked with *

Name
type

Description

CHAT_ID
integer

Identifier of the open line chat.

The identifier can be obtained using the imopenlines.session.open or imopenlines.session.history.get methods.

DIALOG_ID
string

Identifier of the dialog in the format chat<ID>, where <ID> is the identifier of the open line chat.

SESSION_ID
integer

Identifier of the session.

The identifier can be obtained using the imopenlines.session.history.get method in the sessionId field.

USER_CODE
string

String code of the user for the external system channel.

Code format: <connector>|<LINE_ID>|<CONNECTOR_CHAT_ID>|<CONNECTOR_USER_ID>, where:

  • <connector> — identifier of the connector: livechat, telegram, and others
  • <LINE_ID> — identifier of the open line
  • <CONNECTOR_CHAT_ID> — identifier of the chat in the channel
  • <CONNECTOR_USER_ID> — identifier of the user in the channel

The value can be obtained using the imopenlines.session.history.get method from result.chat.<chatId>.entityId.

Code Examples

How to Use Examples in Documentation

curl -X POST \
          -H "Content-Type: application/json" \
          -H "Accept: application/json" \
          -d '{"USER_CODE":"livechat|1|1373|211"}' \
          https://your-domain.bitrix24.com/rest/1/webhook_key/imopenlines.dialog.get.json
        
curl -X POST \
          -H "Content-Type: application/json" \
          -H "Accept: application/json" \
          -d '{"USER_CODE":"livechat|1|1373|211","auth":"<access_token>"}' \
          https://your-domain.bitrix24.com/rest/imopenlines.dialog.get.json
        
try {
            const response = await $b24.callMethod(
                'imopenlines.dialog.get',
                {
                    USER_CODE: 'livechat|1|1373|211',
                }
            );
        
            const { result } = response.getData();
            console.log(result);
        } catch (error) {
            console.error(error);
        }
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'imopenlines.dialog.get',
                    [
                        'USER_CODE' => 'livechat|1|1373|211',
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            if ($result->error()) {
                echo 'Error: ' . $result->error();
            } else {
                echo 'Success: ' . print_r($result->data(), true);
            }
        } catch (Throwable $exception) {
            error_log($exception->getMessage());
            echo 'Error getting dialog: ' . $exception->getMessage();
        }
        
BX24.callMethod(
            'imopenlines.dialog.get',
            {
                USER_CODE: 'livechat|1|1373|211',
            },
            function(result) {
                if (result.error()) {
                    console.error(result.error().ex);
                } else {
                    console.log(result.data());
                }
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'imopenlines.dialog.get',
            [
                'USER_CODE' => 'livechat|1|1373|211',
            ]
        );
        
        if (!empty($result['error'])) {
            echo 'Error: ' . $result['error_description'];
        } else {
            echo 'Success: ' . print_r($result['result'], true);
        }
        

Response Handling

HTTP Status: 200

{
            "result": {
                "id": 1777,
                "parent_chat_id": 0,
                "parent_message_id": 0,
                "name": "Green Guest #17 - Bitrix24 Documentation",
                "description": null,
                "owner": 27,
                "extranet": false,
                "avatar": "",
                "color": "#58cc47",
                "type": "lines",
                "counter": 0,
                "user_counter": 2,
                "message_count": 104,
                "unread_id": 0,
                "restrictions": {
                    "avatar": true,
                    "rename": true,
                    "extend": true,
                    "call": true,
                    "mute": true,
                    "leave": true,
                    "leave_owner": true,
                    "send": true,
                    "user_list": true
                },
                "last_message_id": 86313,
                "last_id": 86313,
                "marked_id": 0,
                "disk_folder_id": 0,
                "entity_type": "LINES",
                "entity_id": "livechat|22|1775|599",
                "entity_data_1": "Y|LEAD|1209|N|N|343|1773682918|0|0|0",
                "entity_data_2": "LEAD|1209|COMPANY|0|CONTACT|0|DEAL|0",
                "entity_data_3": "N",
                "mute_list": [],
                "date_create": "2026-03-13T16:50:15+01:00",
                "message_type": "L",
                "public": "",
                "role": "owner",
                "entity_link": {
                    "type": "LINES",
                    "url": "",
                    "id": "livechat|22|1775|599"
                },
                "text_field_enabled": true,
                "background_id": null,
                "permissions": {
                    "manage_users_add": "member",
                    "manage_users_delete": "manager",
                    "manage_ui": "member",
                    "manage_settings": "owner",
                    "manage_messages": "member",
                    "can_post": "member"
                },
                "is_new": false,
                "readed_list": [
                    {
                        "user_id": 599,
                        "user_name": "Guest",
                        "message_id": 86101,
                        "date": null
                    }
                ],
                "manager_list": [27],
                "last_message_views": {
                    "message_id": 86313,
                    "first_viewers": [
                        {
                            "user_id": 27,
                            "user_name": "Samantha Johnson",
                            "date": "2026-03-16T20:50:37+01:00"
                        }
                    ],
                    "count_of_viewers": 0
                },
                "dialog_id": "chat1777"
            },
            "time": {
                "start": 1773683678,
                "finish": 1773683678.423382,
                "duration": 0.423382043838501,
                "processing": 0,
                "date_start": "2026-03-16T20:54:38+01:00",
                "date_finish": "2026-03-16T20:54:38+01:00",
                "operating_reset_at": 1773684278,
                "operating": 0
            }
        }
        

Returned Data

Name
type

Description

result
object

Chat data object (detailed description)

time
time

Information about the request execution time

Result Object

Name
type

Description

id
integer

Identifier of the chat

parent_chat_id
integer

Identifier of the parent chat

parent_message_id
integer

Identifier of the parent message

name
string

Name of the chat

description
string

Description of the chat or null

owner
integer

Identifier of the chat owner

extranet
boolean

Indicator of an extranet chat

avatar
string

URL of the chat avatar or an empty string

color
string

Color of the chat in HEX format

dialog_id
string

Identifier of the dialog in the format chat<ID>

type
string

Type of the chat, for open lines the value is lines

counter
integer

Number of unread messages for the current user

user_counter
integer

Number of participants with unread messages

message_count
integer

Total number of messages in the chat

unread_id
integer

Identifier of the first unread message or 0

restrictions
object

Permissions for actions with the chat (detailed description)

last_message_id
integer

Identifier of the last message

last_id
integer

Service identifier of the last message

marked_id
integer

Identifier of the marked message or 0

disk_folder_id
integer

Identifier of the Drive folder for chat files

entity_type
string

Type of the chat channel, for open lines the value is LINES

entity_id
string

User code of the open line in the format <connector>|<LINE_ID>|<CONNECTOR_CHAT_ID>|<CONNECTOR_USER_ID>, where:

  • <connector> — identifier of the connector: livechat, telegram, and others
  • <LINE_ID> — identifier of the open line
  • <CONNECTOR_CHAT_ID> — identifier of the chat in the channel
  • <CONNECTOR_USER_ID> — identifier of the user in the channel

entity_data_1
string

String with session data of the open line

entity_data_2
string

String with CRM bindings

entity_data_3
string

Additional service flag

mute_list
array

List of user IDs with notifications turned off

date_create
datetime

Date and time of chat creation in ISO 8601 format (RFC3339)

message_type
string

Type of messages in the chat

public
string

Public flag of the chat

role
string

Role of the current user in the chat

entity_link
object

Link to the external system channel (detailed description)

text_field_enabled
boolean

Whether the message input field is available

background_id
integer

Identifier of the chat background or null

permissions
object

Permissions of the current user in the chat (detailed description)

is_new
boolean

Indicator of a new chat

readed_list
array

List of data about message readings (detailed description)

manager_list
array

List of identifiers of operators assigned as managers

last_message_views
object

Data about the views of the last message (detailed description)

Restrictions Object

Name
type

Description

avatar
boolean

Permission to change the chat avatar

rename
boolean

Permission to change the chat name

extend
boolean

Permission to extend chat settings

call
boolean

Permission for calls in the chat

mute
boolean

Permission to turn off notifications

leave
boolean

Permission to leave the chat

leave_owner
boolean

Permission for the chat owner to leave

send
boolean

Permission to send messages

user_list
boolean

Permission to view the list of participants

Name
type

Description

type
string

Type of the channel, for open lines the value is LINES

url
string

Link to the external object of the channel or an empty string

id
string

External identifier of the dialog in the channel

Permissions Object

Name
type

Description

manage_users_add
string

Permission to add participants

manage_users_delete
string

Permission to remove participants

manage_ui
string

Permission to manage the chat interface

manage_settings
string

Permission to manage chat settings

manage_messages
string

Permission to manage messages

can_post
string

Permission to send messages

Readed List Item Object

Name
type

Description

user_id
integer

Identifier of the user

user_name
string

Name of the user

message_id
integer

Identifier of the last read message

date
datetime

Date and time of reading in ISO 8601 format (RFC3339) or null

Last Message Views Object

Name
type

Description

message_id
integer

Identifier of the message for which view statistics are collected

first_viewers
array

List of users who viewed the message first (detailed description)

count_of_viewers
integer

Number of other users who viewed the message

First Viewer Item Object

Name
type

Description

user_id
integer

Identifier of the user

user_name
string

Name of the user

date
datetime

Date and time of viewing in ISO 8601 format (RFC3339)

Error Handling

HTTP Status: 400

{
            "error": "ACCESS_ERROR",
            "error_description": "You do not have access to the specified dialog"
        }
        

Name
type

Description

error
string

String error code. It may consist of digits, Latin letters, and underscores

error_description
error_description

Textual description of the error. The description is not intended to be shown to the end user in its raw form

Possible Error Codes

Status

Code

Description

Value

400

ACCESS_ERROR

You do not have access to the specified dialog

Dialog not found or no access to it

Statuses and System Error Codes

HTTP Status: 20x, 40x, 50x

The errors described below may occur when calling any method.

Status

Code
Error Message

Description

500

INTERNAL_SERVER_ERROR
Internal server error

An internal server error has occurred, please contact the server administrator or Bitrix24 technical support

500

ERROR_UNEXPECTED_ANSWER
Server returned an unexpected response

An internal server error has occurred, please contact the server administrator or Bitrix24 technical support

503

QUERY_LIMIT_EXCEEDED
Too many requests

The request intensity limit has been exceeded

405

ERROR_BATCH_METHOD_NOT_ALLOWED
Method is not allowed for batch usage

The current method is not allowed to be called using batch

400

ERROR_BATCH_LENGTH_EXCEEDED
Max batch length exceeded

The maximum length of parameters passed to the batch method has been exceeded

401

NO_AUTH_FOUND
Wrong authorization data

Invalid access token or webhook code

400

INVALID_REQUEST
Https required

The methods must be called using the HTTPS protocol

503

OVERLOAD_LIMIT
REST API is blocked due to overload

The REST API is blocked due to overload. This is a manual individual block, to remove it you need to contact Bitrix24 technical support

403

ACCESS_DENIED
REST API is available only on commercial plans

The REST API is available only on commercial plans

403

INVALID_CREDENTIALS
Invalid request credentials

The user whose access token or webhook was used to call the method lacks permissions

404

ERROR_MANIFEST_IS_NOT_AVAILABLE
Manifest is not available

The manifest is not available

403

insufficient_scope
The request requires higher privileges than provided by the webhook token

The request requires higher privileges than those provided by the webhook token

401

expired_token
The access token provided has expired

The provided access token has expired

403

user_access_error
The user does not have access to the application

The user does not have access to the application. This means that the application is installed, but the account administrator has allowed access to this application only for specific users

500

PORTAL_DELETED
Portal was deleted

The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the option "Temporary closure of the public part of the site". Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site

Continue Learning