You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-11-25 22:12:29 +02:00
144 lines
4.0 KiB
Plaintext
Vendored
144 lines
4.0 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 1
|
|
description: Get message queue and other functions to work with GreenAPI 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, GreenAPI]
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
# Get message queue
|
|
Gets the list of messages in the queue to be sent
|
|
|
|
|
|
|
|
`Function GetMessageQueue(Val AccessParameters) Export`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| AccessParameters | --access | Structure Of KeyAndValue | ✔ | Access parameters. See FormAccessParameters |
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Green API
|
|
|
|
<br/>
|
|
|
|
:::tip
|
|
Method at API documentation: [ShowMessagesQueue](https://green-api.com/docs/api/queues/ShowMessagesQueue/)
|
|
:::
|
|
<br/>
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
ApiUrl = "https://7105.api.greenapi.com";
|
|
MediaUrl = "https://7105.media.greenapi.com";
|
|
IdInstance = "71051...";
|
|
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
|
|
|
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
|
Result = OPI_GreenAPI.GetMessageQueue(AccessParameters);
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
# JSON data can also be passed as a path to a .json file
|
|
|
|
oint greenapi GetMessageQueue \
|
|
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}"
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
```batch
|
|
:: JSON data can also be passed as a path to a .json file
|
|
|
|
oint greenapi GetMessageQueue ^
|
|
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
[
|
|
{
|
|
"messageID": "BAE5B8457AE5FC88",
|
|
"type": "sendMessage",
|
|
"body": {
|
|
"chatId": "120363410406221140@g.us",
|
|
"message": "New message",
|
|
"linkPreview": true,
|
|
"typingTime": null,
|
|
"typePreview": "small"
|
|
}
|
|
},
|
|
{
|
|
"messageID": "BAE50DE3D325C617",
|
|
"type": "sendMessage",
|
|
"body": {
|
|
"chatId": "120363410406221140@g.us",
|
|
"message": "New message",
|
|
"quotedMessageId": "BAE5B8457AE5FC88",
|
|
"linkPreview": true,
|
|
"typingTime": null,
|
|
"typePreview": "small"
|
|
}
|
|
},
|
|
{
|
|
"messageID": "BAE5C8B93FC989C5",
|
|
"type": "sendFileByUrl",
|
|
"body": {
|
|
"fileName": "photo.jpg",
|
|
"chatId": "120363410406221140@g.us",
|
|
"caption": "File description",
|
|
"archive": false,
|
|
"urlFile": "https://do-mediaout-7105.fra1.digitaloceanspaces.com/7105187566/0ba995d0-5b11-4861-99b5-729204b596d2.jpg",
|
|
"typingTime": null,
|
|
"typingType": "composing"
|
|
}
|
|
},
|
|
{
|
|
"messageID": "BAE5F48C5BFFB882",
|
|
"type": "sendFileByUrl",
|
|
"body": {
|
|
"fileName": "vid.mp4",
|
|
"chatId": "120363410406221140@g.us",
|
|
"quotedMessageId": "BAE5C8B93FC989C5",
|
|
"caption": "File description",
|
|
"archive": false,
|
|
"urlFile": "https://do-mediaout-7105.fra1.digitaloceanspaces.com/7105187566/e74ea56d-b09a-4f61-a83d-836d8d6d10b3.mp4",
|
|
"typingTime": null,
|
|
"typingType": "composing"
|
|
}
|
|
},
|
|
{
|
|
"messageID": "BAE5D97C67FBD0D9",
|
|
"type": "sendFileByUrl",
|
|
"body": {
|
|
"chatId": "120363410406221140@g.us",
|
|
"urlFile": "https://hut.openintegrations.dev/test_data/picture.jpg",
|
|
"fileName": "photo.jpg",
|
|
"caption": "File description",
|
|
"typingTime": null,
|
|
"typingType": "composing"
|
|
}
|
|
},
|
|
{
|
|
"messageID": "BAE59BF0B798E59A",
|
|
"type": "sendFileByUrl",
|
|
"body": {
|
|
"chatId": "120363410406221140@g.us",
|
|
"urlFile": "https://hut.openintegrations.dev/test_data/video.mp4",
|
|
"fileName": "vid.mp4",
|
|
"caption": "File description",
|
|
"quotedMessageId": "BAE5D97C67FBD0D9",
|
|
"typingTime": null,
|
|
"typingType": "composing"
|
|
}
|
|
}
|
|
]
|
|
```
|