1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-04-25 12:24:39 +02:00

129 lines
2.8 KiB
Markdown
Raw Normal View History

---
sidebar_position: 14
---
# Get dialog
Get chat data by ID
`Function GetDialog(Val URL, Val ChatID, Val Token = "") Export`
| Parameter | CLI option | Type | Description |
|-|-|-|-|
| URL | --url | String | URL of webhook or a Bitrix24 domain, when token used |
| ChatID | --chat | String, Number | Chat ID (as chatXXX) or User ID (as XXX) |
| Token | --token | String | Access token, when app auth method used |
Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
<br/>
:::tip
Method at API documentation: [im.dialog.get](https://dev.1c-bitrix.ru/learning/course/?COURSE_ID=93&LESSON_ID=12886)
:::
<br/>
```bsl title="Code example"
2024-09-24 11:38:18 +03:00
URL = "https://b24-ar17wx.bitrix24.by/rest/1/1o2...";
2024-10-15 10:07:27 +03:00
ChatID = "chat" + "1006";
2024-08-13 16:47:32 +03:00
Result = OPI_Bitrix24.GetDialog(URL, ChatID);
2024-09-24 11:38:18 +03:00
URL = "b24-ar17wx.bitrix24.by";
2024-10-15 10:07:27 +03:00
Token = "21750a67006e9f06006b12e400000001000...";
2024-08-13 16:47:32 +03:00
UserID = 10;
Result = OPI_Bitrix24.GetDialog(URL, UserID, Token);
```
2024-10-15 09:53:37 +03:00
```json title="Result"
2024-08-14 09:06:31 +03:00
{
2024-10-06 16:55:08 +03:00
"result": {
"id": 10,
"parent_chat_id": 0,
"parent_message_id": 0,
"name": "",
"description": "",
"owner": 10,
"extranet": false,
"avatar": "",
"color": "#ab7761",
"type": "private",
2024-10-06 16:55:08 +03:00
"counter": 4,
"user_counter": 0,
2024-10-09 09:42:00 +03:00
"message_count": 187,
2024-10-06 16:55:08 +03:00
"unread_id": 16,
"restrictions": {
2024-10-06 16:55:08 +03:00
"avatar": true,
"rename": true,
"extend": true,
"call": true,
"mute": true,
"leave": true,
"leave_owner": true,
"send": true,
"user_list": true
},
2024-10-09 09:42:00 +03:00
"last_message_id": 17682,
2024-10-06 16:55:08 +03:00
"last_id": 0,
"marked_id": 0,
"disk_folder_id": 0,
"entity_type": "",
"entity_id": "",
"entity_data_1": "",
"entity_data_2": "",
"entity_data_3": "",
"mute_list": [],
2024-10-06 16:55:08 +03:00
"date_create": "2024-06-15T19:48:49+03:00",
"message_type": "P",
"disappearing_time": 0,
"public": "",
"role": "member",
"entity_link": {
2024-10-06 16:55:08 +03:00
"type": "",
"url": ""
},
"permissions": {
2024-10-06 16:55:08 +03:00
"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": [
2024-10-06 16:55:08 +03:00
{
"user_id": 10,
"user_name": "Techno Pizza",
"message_id": 3854,
"date": null
}
],
"manager_list": [],
"last_message_views": {
2024-10-09 09:42:00 +03:00
"message_id": 17682,
2024-10-06 16:55:08 +03:00
"first_viewers": [],
"count_of_viewers": 0
},
"dialog_id": "10"
2024-10-06 16:55:08 +03:00
},
"time": {
2024-10-09 09:42:00 +03:00
"start": 1728454899.5196,
"finish": 1728454899.56299,
"duration": 0.0433859825134277,
"processing": 0.0178430080413818,
"date_start": "2024-10-09T09:21:39+03:00",
"date_finish": "2024-10-09T09:21:39+03:00",
"operating_reset_at": 1728455499,
"operating": 0
2024-10-06 16:55:08 +03:00
}
}
```