Get Chat Data with imbot.dialog.get
Scope:
imbotWho can execute the method: user with access to the chat
The method imbot.dialog.get returns chat data.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
DIALOG_ID* |
Identifier of the object. Supported formats:
|
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"DIALOG_ID":"chat2725"}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/imbot.dialog.get
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"DIALOG_ID":"chat2725","auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/imbot.dialog.get
try
{
const response = await $b24.callMethod(
'imbot.dialog.get',
{
DIALOG_ID: 'chat2725',
}
);
const result = response.getData().result;
console.log('Dialog data:', result);
processResult(result);
}
catch( error )
{
console.error('Error:', error);
}
try {
$response = $b24Service
->core
->call(
'imbot.dialog.get',
[
'DIALOG_ID' => 'chat2725'
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
processData($result);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error getting dialog: ' . $e->getMessage();
}
BX24.callMethod(
'imbot.dialog.get',
{
DIALOG_ID: 'chat2725'
},
function (result)
{
if (result.error())
console.error(result.error());
else
console.dir(result.data());
}
);
require_once('crest.php');
$result = CRest::call(
'imbot.dialog.get',
[
'DIALOG_ID' => 'chat2725'
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Response Handling
HTTP Status: 200
{
"result": {
"id": 2725,
"parent_chat_id": 0,
"parent_message_id": 0,
"name": "New Chat Name",
"description": "Important News",
"owner": 1291,
"extranet": false,
"avatar": "https://cdn.com.bitrix24.com/b13743910/resize_cache/33079/ff58db95aecdfa09ae61b51b5fd8f63f/im/708/70810b67c7c206ca3477933063b8ebbc/zuc0242aflwpzacvndxwnfhuxhzvgjaq",
"color": "#f76187",
"type": "chat",
"counter": 0,
"user_counter": 2,
"message_count": 11,
"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": 33807,
"last_id": 33807,
"marked_id": 0,
"disk_folder_id": 0,
"entity_type": "CHAT",
"entity_id": "13",
"entity_data_1": "",
"entity_data_2": "",
"entity_data_3": "",
"mute_list": [],
"date_create": "2026-02-24T13:19:39+01:00",
"message_type": "C",
"public": "",
"role": "member",
"entity_link": {
"type": "CHAT",
"url": "",
"id": "13"
},
"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": 1291,
"user_name": "MyBot",
"message_id": 33807,
"date": null
}
],
"manager_list": [1291],
"last_message_views": {
"message_id": 33807,
"first_viewers": [
{
"user_id": 1271,
"user_name": "Employee",
"date": "2026-02-24T15:41:17+01:00"
}
],
"count_of_viewers": 0
},
"dialog_id": "chat2725"
},
"time": {
"start": 1771937178,
"finish": 1771937178.934208,
"duration": 0.9342079162597656,
"processing": 0,
"date_start": "2026-02-24T15:46:18+01:00",
"date_finish": "2026-02-24T15:46:18+01:00",
"operating_reset_at": 1771937778,
"operating": 0
}
}
Returned Data
|
Name |
Description |
|
result |
Object with chat description |
|
time |
Information about the request execution time |
Error Handling
HTTP Status: 400, 403
{
"error": "DIALOG_ID_EMPTY",
"error_description": "Dialog ID can't be empty"
}
|
Name |
Description |
|
error |
String error code. It may consist of digits, Latin letters, and underscores |
|
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
|
Code |
Description |
Value |
|
|
Dialog ID can't be empty |
No |
|
|
You do not have access to the specified dialog |
No access to the specified dialog |
|
|
You don't have access to this chat |
No access to the specified chat |
Statuses and System Error Codes
HTTP Status: 20x, 40x, 50x
The errors described below may occur when calling any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The current method is not allowed to be called using batch |
|
|
|
The maximum length of parameters passed to the batch method has been exceeded |
|
|
|
Invalid access token or webhook code |
|
|
|
The methods must be called using the HTTPS protocol |
|
|
|
The REST API is blocked due to overload. This is a manual individual block, to remove it you need to contact Bitrix24 technical support |
|
|
|
The REST API is available only on commercial plans |
|
|
|
The user whose access token or webhook was used to call the method lacks permissions |
|
|
|
The manifest is not available |
|
|
|
The request requires higher privileges than those provided by the webhook token |
|
|
|
The provided access token has expired |
|
|
|
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 |
|
|
|
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
- Create a Chat on Behalf of the Chatbot imbot.chat.add
- Add Participants to Chat imbot.chat.user.add
- Assign or Revoke Chat Administrator Rights imbot.chat.setManager
- Change Chat Title imbot.chat.updateTitle
- Change Chat Avatar imbot.chat.updateAvatar
- Change Chat Color imbot.chat.updateColor
- Get Chat ID imbot.chat.get
- Get the List of Chat Participants imbot.chat.user.list
- Exclude Participants from Chat imbot.chat.user.delete
- Chat Bot Exit from Specified Chat imbot.chat.leave