You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-11-29 22:27:42 +02:00
227 lines
5.3 KiB
Plaintext
Vendored
227 lines
5.3 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 13
|
|
description: Get chat messages list and other functions to work with Bitrix24 in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
|
|
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Bitrix24]
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
# Get chat messages list
|
|
Gets a list of 20 chat or dialog messages, depending on the FirstID and LastID specified
|
|
|
|
|
|
|
|
`Function GetChatMessagesList(Val URL, Val ChatID, Val LastID = "", Val FirstID = "", Val Token = "") Export`
|
|
|
|
| Parameter | CLI option | Type | Required | 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) |
|
|
| LastID | --last | String, Number | ✖ | Id of last message |
|
|
| FirstID | --first | String, Number | ✖ | ID of first message |
|
|
| 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.messages.get](https://dev.1c-bitrix.ru/learning/course/?COURSE_ID=93&LESSON_ID=11479)
|
|
:::
|
|
<br/>
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
URL = "https://b24-ar17wx.bitrix24.by/rest/1/h0m...";
|
|
ChatID = "chat4";
|
|
|
|
Result = OPI_Bitrix24.GetChatMessagesList(URL, ChatID);
|
|
|
|
URL = "b24-ar17wx.bitrix24.by";
|
|
Token = "c866e568006e9f06006b12e400000001000...";
|
|
UserID = 10;
|
|
|
|
Result = OPI_Bitrix24.GetChatMessagesList(URL, UserID, , 0, Token);
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
oint bitrix24 GetChatMessagesList \
|
|
--url "b24-ar17wx.bitrix24.by" \
|
|
--chat 10 \
|
|
--first 0 \
|
|
--token "***"
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
```batch
|
|
oint bitrix24 GetChatMessagesList ^
|
|
--url "b24-ar17wx.bitrix24.by" ^
|
|
--chat 10 ^
|
|
--first 0 ^
|
|
--token "***"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
{
|
|
"result": {
|
|
"chat_id": 10,
|
|
"messages": [
|
|
{
|
|
"id": 16,
|
|
"chat_id": 10,
|
|
"author_id": 0,
|
|
"date": "2024-06-15T16:48:49+00:00",
|
|
"text": "Я с вами в команде!",
|
|
"unread": false,
|
|
"uuid": null,
|
|
"replaces": [],
|
|
"params": {
|
|
"CODE": [
|
|
"USER_JOIN"
|
|
]
|
|
},
|
|
"disappearing_date": null
|
|
},
|
|
{
|
|
"id": 3808,
|
|
"chat_id": 10,
|
|
"author_id": 1,
|
|
"date": "2024-07-13T14:45:29+00:00",
|
|
"text": "Сообщение для теста",
|
|
"unread": false,
|
|
"uuid": null,
|
|
"replaces": [],
|
|
"params": [],
|
|
"disappearing_date": null
|
|
},
|
|
{
|
|
"id": 3810,
|
|
"chat_id": 10,
|
|
"author_id": 10,
|
|
"date": "2024-07-13T14:46:31+00:00",
|
|
"text": "Понял",
|
|
"unread": false,
|
|
"uuid": null,
|
|
"replaces": [],
|
|
"params": [],
|
|
"disappearing_date": null
|
|
},
|
|
{
|
|
"id": 3852,
|
|
"chat_id": 10,
|
|
"author_id": 10,
|
|
"date": "2024-07-13T14:54:42+00:00",
|
|
"text": "Принял",
|
|
"unread": false,
|
|
"uuid": null,
|
|
"replaces": [],
|
|
"params": [],
|
|
"disappearing_date": null
|
|
},
|
|
{
|
|
"id": 3854,
|
|
"chat_id": 10,
|
|
"author_id": 10,
|
|
"date": "2024-07-13T14:54:43+00:00",
|
|
"text": "Записал",
|
|
"unread": false,
|
|
"uuid": null,
|
|
"replaces": [],
|
|
"params": [],
|
|
"disappearing_date": null
|
|
},
|
|
{
|
|
"id": 4286,
|
|
"chat_id": 10,
|
|
"author_id": 1,
|
|
"date": "2024-07-13T16:06:51+00:00",
|
|
"text": "Текст сообщения",
|
|
"unread": false,
|
|
"uuid": null,
|
|
"replaces": [],
|
|
"params": [],
|
|
"disappearing_date": null
|
|
},
|
|
{
|
|
"id": 4366,
|
|
"chat_id": 10,
|
|
"author_id": 1,
|
|
"date": "2024-07-13T16:40:58+00:00",
|
|
"text": "Message text",
|
|
"unread": false,
|
|
"uuid": null,
|
|
"replaces": [],
|
|
"params": [],
|
|
"disappearing_date": null
|
|
},
|
|
{
|
|
"id": 4406,
|
|
"chat_id": 10,
|
|
"author_id": 1,
|
|
"date": "2024-07-13T19:57:33+00:00",
|
|
"text": "Это сообщение было удалено",
|
|
"unread": false,
|
|
"uuid": null,
|
|
"replaces": [],
|
|
"params": {
|
|
"IS_DELETED": "Y"
|
|
},
|
|
"disappearing_date": null
|
|
},
|
|
{
|
|
"id": 4446,
|
|
"chat_id": 10,
|
|
"author_id": 1,
|
|
"date": "2024-07-13T20:21:27+00:00",
|
|
"text": "Текст сообщения",
|
|
"unread": false,
|
|
"uuid": null,
|
|
"replaces": [],
|
|
"params": [],
|
|
"disappearing_date": null
|
|
},
|
|
{
|
|
"id": 4486,
|
|
"chat_id": 10,
|
|
"author_id": 1,
|
|
"date": "2024-07-13T20:22:30+00:00",
|
|
"text": "Это сообщение было удалено",
|
|
"unread": false,
|
|
"uuid": null,
|
|
"replaces": [],
|
|
"params": {
|
|
"IS_DELETED": "Y"
|
|
},
|
|
"disappearing_date": null
|
|
},
|
|
{
|
|
"id": 4526,
|
|
"chat_id": 10,
|
|
"author_id": 1,
|
|
"date": "2024-07-13T20:41:21+00:00",
|
|
"text": "Это сообщение было удалено",
|
|
"unread": false,
|
|
"uuid": null,
|
|
"replaces": [],
|
|
"params": {
|
|
"IS_DELETED": "Y"
|
|
},
|
|
"disappearing_date": null
|
|
},
|
|
{
|
|
"id": 4668,
|
|
"chat_id": 10,
|
|
"author_id": 1,
|
|
...
|
|
```
|