You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2026-05-04 20:54:02 +02:00
210 lines
4.9 KiB
Plaintext
Vendored
210 lines
4.9 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
|
|
|
|
:::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": "3EB058F495DBC057E0ECE7",
|
|
"type": "sendFileByUrl",
|
|
"body": {
|
|
"chatId": "***",
|
|
"urlFile": "https://hut.openintegrations.dev/test_data/picture.jpg",
|
|
"fileName": "photo.jpg",
|
|
"caption": "File description",
|
|
"typingTime": null,
|
|
"typingType": "composing"
|
|
}
|
|
},
|
|
{
|
|
"messageID": "3EB0E623B04EA234EFE2A2",
|
|
"type": "sendFileByUrl",
|
|
"body": {
|
|
"chatId": "***",
|
|
"urlFile": "https://hut.openintegrations.dev/test_data/video.mp4",
|
|
"fileName": "vid.mp4",
|
|
"caption": "File description",
|
|
"quotedMessageId": "3EB058F495DBC057E0ECE7",
|
|
"typingTime": null,
|
|
"typingType": "composing"
|
|
}
|
|
},
|
|
{
|
|
"messageID": "3EB0008145A1000A78ED3F",
|
|
"type": "sendPoll",
|
|
"body": {
|
|
"chatId": "***",
|
|
"message": "What's your favorite color??",
|
|
"options": [
|
|
{
|
|
"optionName": "Red"
|
|
},
|
|
{
|
|
"optionName": "Yellow"
|
|
},
|
|
{
|
|
"optionName": "Green"
|
|
}
|
|
],
|
|
"multipleAnswers": false,
|
|
"typingTime": null
|
|
}
|
|
},
|
|
{
|
|
"messageID": "3EB0D7D99170E2CCB833D2",
|
|
"type": "sendPoll",
|
|
"body": {
|
|
"chatId": "***",
|
|
"message": "What's your favorite color??",
|
|
"options": [
|
|
{
|
|
"optionName": "Red"
|
|
},
|
|
{
|
|
"optionName": "Yellow"
|
|
},
|
|
{
|
|
"optionName": "Green"
|
|
}
|
|
],
|
|
"multipleAnswers": true,
|
|
"quotedMessageId": "3EB0008145A1000A78ED3F",
|
|
"typingTime": null
|
|
}
|
|
},
|
|
{
|
|
"messageID": "3EB0F9DD0A158EAB9DC305",
|
|
"type": "sendLocation",
|
|
"body": {
|
|
"chatId": "***",
|
|
"latitude": 53.908522,
|
|
"longitude": 27.574821,
|
|
"address": "Victory Square, Minsk",
|
|
"nameLocation": "Victory sq.",
|
|
"typingTime": null
|
|
}
|
|
},
|
|
{
|
|
"messageID": "3EB0A24E80F21C9BA854C7",
|
|
"type": "sendLocation",
|
|
"body": {
|
|
"chatId": "***",
|
|
"quotedMessageId": "3EB0F9DD0A158EAB9DC305",
|
|
"latitude": 53.908522,
|
|
"longitude": 27.574821,
|
|
"typingTime": null
|
|
}
|
|
},
|
|
{
|
|
"messageID": "3EB081F1972488EA3E5EA2",
|
|
"type": "sendContact",
|
|
"body": {
|
|
"chatId": "***",
|
|
"contact": {
|
|
"phoneContact": "***",
|
|
"firstName": "Artem",
|
|
"middleName": "Evpatoriysky",
|
|
"lastName": "Petrovich",
|
|
"company": "Bicycle"
|
|
},
|
|
"typingTime": null
|
|
}
|
|
},
|
|
{
|
|
"messageID": "3EB00F85F2B99B7BB6B477",
|
|
"type": "sendContact",
|
|
"body": {
|
|
"chatId": "***",
|
|
"contact": {
|
|
"phoneContact": "***",
|
|
"company": "Bicycle"
|
|
},
|
|
"quotedMessageId": "3EB081F1972488EA3E5EA2",
|
|
"typingTime": null
|
|
}
|
|
},
|
|
{
|
|
"messagesIDs": [
|
|
"3EB063D9112523A492AFC9"
|
|
],
|
|
"type": "ForwardMessages",
|
|
"body": {
|
|
"chatId": "***",
|
|
"chatIdFrom": "***",
|
|
"messages": [
|
|
"3EB0CE9B173AD7D98D3D70"
|
|
],
|
|
"typingTime": null
|
|
}
|
|
},
|
|
{
|
|
"messageID": "3EB00DDA746B0B0B716A68",
|
|
"type": "editMessage",
|
|
"body": {
|
|
"chatId": "***",
|
|
"idMessage": "3EB0CE9B173AD7D98D3D70",
|
|
"message": "New message text",
|
|
"linkPreview": true
|
|
}
|
|
}
|
|
]
|
|
```
|