1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-29 22:27:42 +02:00

Main build (Jenkins)

This commit is contained in:
Vitaly the Alpaca (bot)
2025-10-17 09:03:05 +03:00
parent de6c831f4d
commit 3ae25c4ef9
301 changed files with 9503 additions and 9197 deletions

View File

@@ -0,0 +1,77 @@
---
sidebar_position: 9
description: Delete message and other functions to work with Green API 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, Green API]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Delete message
Deletes a message in the selected chat room
`Function DeleteMessage(Val AccessParameters, Val ChatID, Val MessageID, Val ForSenderOnly = False) Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| AccessParameters | --access | Structure Of KeyAndValue | ✔ | Access parameters. See FormAccessParameters |
| ChatID | --chat | String | ✔ | Chat identifier |
| MessageID | --message | String | ✔ | Message identifier |
| ForSenderOnly | --sender | Boolean | ✖ | Delete for sender only |
Returns: Map Of KeyAndValue - serialized JSON response from Green API
<br/>
:::tip
Method at API documentation: [DeleteMessage](https://green-api.com/docs/api/service/deleteMessage/)
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
ApiUrl = "https://7105.api.greenapi.com";
MediaUrl = "https://7105.media.greenapi.com";
IdInstance = "71051...";
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
ChatID = "120363410406221140@g.us";
MessageID = "BAE55A7CCFCF5EF4";
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenAPI.DeleteMessage(AccessParameters, ChatID, MessageID);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
# JSON data can also be passed as a path to a .json file
oint greenapi DeleteMessage \
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" \
--chat "120363410406221140@g.us" \
--message "BAE5C5FA375FA242"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
:: JSON data can also be passed as a path to a .json file
oint greenapi DeleteMessage ^
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" ^
--chat "120363410406221140@g.us" ^
--message "BAE5C5FA375FA242"
```
</TabItem>
</Tabs>
```json title="Result"
{}
```

View File

@@ -0,0 +1,82 @@
---
sidebar_position: 8
description: Change the message text and other functions to work with Green API 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, Green API]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Change the message text
Changes the text of the message
`Function EditMessageText(Val AccessParameters, Val ChatID, Val MessageID, Val Text) Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| AccessParameters | --access | Structure Of KeyAndValue | &#x2714; | Access parameters. See FormAccessParameters |
| ChatID | --chat | String | &#x2714; | Chat identifier |
| MessageID | --message | String | &#x2714; | Message identifier |
| Text | --text | String | &#x2714; | New message text |
Returns: Map Of KeyAndValue - serialized JSON response from Green API
<br/>
:::tip
Method at API documentation: [EditMessage](https://green-api.com/docs/api/service/EditMessage/)
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
ApiUrl = "https://7105.api.greenapi.com";
MediaUrl = "https://7105.media.greenapi.com";
IdInstance = "71051...";
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
ChatID = "120363410406221140@g.us";
MessageID = "BAE55A7CCFCF5EF4";
Text = "New message text";
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenAPI.EditMessageText(AccessParameters, ChatID, MessageID, Text);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
# JSON data can also be passed as a path to a .json file
oint greenapi EditMessageText \
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" \
--chat "120363410406221140@g.us" \
--message "BAE5C5FA375FA242" \
--text "New message text"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
:: JSON data can also be passed as a path to a .json file
oint greenapi EditMessageText ^
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" ^
--chat "120363410406221140@g.us" ^
--message "BAE5C5FA375FA242" ^
--text "New message text"
```
</TabItem>
</Tabs>
```json title="Result"
{
"idMessage": "BAE5F026D3B87A76"
}
```

View File

@@ -0,0 +1,85 @@
---
sidebar_position: 7
description: Forward messages and other functions to work with Green API 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, Green API]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Forward messages
Sends messages from one chat room to another
`Function ForwardMessages(Val AccessParameters, Val From, Val Target, Val Messages) Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| AccessParameters | --access | Structure Of KeyAndValue | &#x2714; | Access parameters. See FormAccessParameters |
| From | --from | String | &#x2714; | Message source chat ID |
| Target | --to | String | &#x2714; | Message receiver chat ID |
| Messages | --msgs | String, Array of String | &#x2714; | Messages or a single message to be sent |
Returns: Map Of KeyAndValue - serialized JSON response from Green API
<br/>
:::tip
Method at API documentation: [ForwardMessages](https://green-api.com/docs/api/sending/ForwardMessages/)
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
ApiUrl = "https://7105.api.greenapi.com";
MediaUrl = "https://7105.media.greenapi.com";
IdInstance = "71051...";
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
From = "11001234567@c.us";
Target = "120363410406221140@g.us";
Message = "BAE55A7CCFCF5EF4";
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenAPI.ForwardMessages(AccessParameters, From, Target, Message);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
# JSON data can also be passed as a path to a .json file
oint greenapi ForwardMessages \
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" \
--from "120363410406221140@g.us" \
--to "120363410406221140@g.us" \
--msgs "BAE5C5FA375FA242"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
:: JSON data can also be passed as a path to a .json file
oint greenapi ForwardMessages ^
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" ^
--from "120363410406221140@g.us" ^
--to "120363410406221140@g.us" ^
--msgs "BAE5C5FA375FA242"
```
</TabItem>
</Tabs>
```json title="Result"
{
"messages": [
"BAE5C6CC4B06B977"
]
}
```

View File

@@ -0,0 +1,71 @@
---
sidebar_position: 10
description: Get contact description and other functions to work with Green API 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, Green API]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Get contact description
Gets the contact description for the SendContact function
`Function GetContactDescription(Val Phone, Val Name = "", Val LastName = "", Val Patronymic = "", Val Company = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Phone | --phone | Number | &#x2714; | Phone number in international format without a plus sign |
| Name | --name | String | &#x2716; | Contact name |
| LastName | --surname | String | &#x2716; | Contact last name |
| Patronymic | --midname | String | &#x2716; | Contacts patronymic or middle name |
| Company | --company | String | &#x2716; | Name of the contact company |
Returns: Structure Of KeyAndValue - Contact description
<br/>
```bsl title="1C:Enterprise/OneScript code example"
Phone = 79001234568;
Name = "Artem";
LastName = "Evpatoriysky";
Patronymic = "Petrovich";
Company = "Bicycle";
Result = OPI_GreenAPI.GetContactDescription(Phone, Name, LastName, Patronymic, Company);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint greenapi GetContactDescription \
--phone 79001234568 \
--company "Bicycle"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint greenapi GetContactDescription ^
--phone 79001234568 ^
--company "Bicycle"
```
</TabItem>
</Tabs>
```json title="Result"
{
"phoneContact": 79001234568,
"firstName": "Artem",
"middleName": "Evpatoriysky",
"lastName": "Petrovich",
"company": "Bicycle"
}
```

View File

@@ -0,0 +1,68 @@
---
sidebar_position: 11
description: Get location description and other functions to work with Green API 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, Green API]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Get location description
Gets the description of the location to send with SendLocation method
`Function GetLocationDescription(Val Latitude, Val Longitude, Val Address = "", Val Name = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Latitude | --lat | Number | &#x2714; | Geographic latitude |
| Longitude | --long | Number | &#x2714; | Geographic longitude |
| Address | --addr | String | &#x2716; | Location address |
| Name | --name | String | &#x2716; | Location name |
Returns: Structure Of KeyAndValue - Location description
<br/>
```bsl title="1C:Enterprise/OneScript code example"
Latitude = 53.908522;
Longitude = 27.574821;
Address = "Victory Square, Minsk";
Name = "Victory sq.";
Result = OPI_GreenAPI.GetLocationDescription(Latitude, Longitude, Address, Name);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint greenapi GetLocationDescription \
--lat 53.908522 \
--long 27.574821
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint greenapi GetLocationDescription ^
--lat 53.908522 ^
--long 27.574821
```
</TabItem>
</Tabs>
```json title="Result"
{
"latitude": 53.908522,
"longitude": 27.574821,
"address": "Victory Square, Minsk",
"nameLocation": "Victory sq."
}
```

View File

@@ -0,0 +1,88 @@
---
sidebar_position: 6
description: Send contact and other functions to work with Green API 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, Green API]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Send contact
Sends a contact with a phone number to the selected chat room
`Function SendContact(Val AccessParameters, Val ChatID, Val Contact, Val ReplyID = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| AccessParameters | --access | Structure Of KeyAndValue | &#x2714; | Access parameters. See FormAccessParameters |
| ChatID | --chat | String | &#x2714; | Chat identifier |
| Contact | --contact | Structure Of KeyAndValue | &#x2714; | Contact description. See GetContactDescription |
| ReplyID | --quoted | String | &#x2716; | Replying message id if necessary |
Returns: Map Of KeyAndValue - serialized JSON response from Green API
<br/>
:::tip
Method at API documentation: [SendContact](https://green-api.com/docs/api/sending/SendContact/)
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
ApiUrl = "https://7105.api.greenapi.com";
MediaUrl = "https://7105.media.greenapi.com";
IdInstance = "71051...";
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
ChatID = "120363410406221140@g.us";
Phone = 79001234568;
Name = "Artem";
LastName = "Evpatoriysky";
Patronymic = "Petrovich";
Company = "Bicycle";
Contact = OPI_GreenAPI.GetContactDescription(Phone, Name, LastName, Patronymic, Company);
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenAPI.SendContact(AccessParameters, ChatID, Contact);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
# JSON data can also be passed as a path to a .json file
oint greenapi SendContact \
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" \
--chat "120363410406221140@g.us" \
--contact "{'phoneContact':79001234568,'company':'Bicycle'}" \
--quoted "BAE59868DDDF0449"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
:: JSON data can also be passed as a path to a .json file
oint greenapi SendContact ^
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" ^
--chat "120363410406221140@g.us" ^
--contact "{'phoneContact':79001234568,'company':'Bicycle'}" ^
--quoted "BAE59868DDDF0449"
```
</TabItem>
</Tabs>
```json title="Result"
{
"idMessage": "BAE531BE583D5FBE"
}
```

View File

@@ -0,0 +1,89 @@
---
sidebar_position: 3
description: Send file by URL and other functions to work with Green API 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, Green API]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Send file by URL
Sends a file from web to the selected chat room
`Function SendFileByURL(Val AccessParameters, Val ChatID, Val FileURL, Val FileName, Val Description = "", Val ReplyID = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| AccessParameters | --access | Structure Of KeyAndValue | &#x2714; | Access parameters. See FormAccessParameters |
| ChatID | --chat | String | &#x2714; | Chat identifier |
| FileURL | --url | String | &#x2714; | File URL |
| FileName | --filename | String | &#x2714; | Name of the file with the extension |
| Description | --caption | String | &#x2716; | Message text below the file |
| ReplyID | --quoted | String | &#x2716; | Replying message id if necessary |
Returns: Map Of KeyAndValue - serialized JSON response from Green API
<br/>
:::tip
Method at API documentation: [SendFileByUrl](https://green-api.com/docs/api/sending/SendFileByUrl/)
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
ApiUrl = "https://7105.api.greenapi.com";
MediaUrl = "https://7105.media.greenapi.com";
IdInstance = "71051...";
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
File = "https://hut.openintegrations.dev/test_data/picture.jpg";
FileName = "photo.jpg";
ChatID = "120363410406221140@g.us";
Description = "File description";
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenAPI.SendFileByURL(AccessParameters, ChatID, File, FileName, Description);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
# JSON data can also be passed as a path to a .json file
oint greenapi SendFileByURL \
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" \
--chat "120363410406221140@g.us" \
--url "https://hut.openintegrations.dev/test_data/video.mp4" \
--filename "vid.mp4" \
--caption "File description" \
--quoted "BAE5D97C67FBD0D9"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
:: JSON data can also be passed as a path to a .json file
oint greenapi SendFileByURL ^
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" ^
--chat "120363410406221140@g.us" ^
--url "https://hut.openintegrations.dev/test_data/video.mp4" ^
--filename "vid.mp4" ^
--caption "File description" ^
--quoted "BAE5D97C67FBD0D9"
```
</TabItem>
</Tabs>
```json title="Result"
{
"idMessage": "BAE5D97C67FBD0D9"
}
```

View File

@@ -0,0 +1,92 @@
---
sidebar_position: 2
description: Send file and other functions to work with Green API 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, Green API]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Send file
Sends the file to the selected chat room
`Function SendFile(Val AccessParameters, Val ChatID, Val File, Val FileName, Val Description = "", Val ReplyID = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| AccessParameters | --access | Structure Of KeyAndValue | &#x2714; | Access parameters. See FormAccessParameters |
| ChatID | --chat | String | &#x2714; | Chat identifier |
| File | --file | String, BinaryData | &#x2714; | File data or filepath |
| FileName | --filename | String | &#x2714; | Name of the file with the extension |
| Description | --caption | String | &#x2716; | Message text below the file |
| ReplyID | --quoted | String | &#x2716; | Replying message id if necessary |
Returns: Map Of KeyAndValue - serialized JSON response from Green API
<br/>
:::tip
Method at API documentation: [SendFileByUpload](https://green-api.com/docs/api/sending/SendFileByUpload/)
Parameters with Binary data type can also accept file paths on disk and URLs
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
ApiUrl = "https://7105.api.greenapi.com";
MediaUrl = "https://7105.media.greenapi.com";
IdInstance = "71051...";
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
File = "https://hut.openintegrations.dev/test_data/picture.jpg"; // URL, Path or Binary Data
FileName = "photo.jpg";
ChatID = "120363410406221140@g.us";
Description = "File description";
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenAPI.SendFile(AccessParameters, ChatID, File, FileName, Description);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
# JSON data can also be passed as a path to a .json file
oint greenapi SendFile \
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" \
--chat "120363410406221140@g.us" \
--file "https://hut.openintegrations.dev/test_data/video.mp4" \
--filename "vid.mp4" \
--caption "File description" \
--quoted "BAE5C8B93FC989C5"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
:: JSON data can also be passed as a path to a .json file
oint greenapi SendFile ^
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" ^
--chat "120363410406221140@g.us" ^
--file "https://hut.openintegrations.dev/test_data/video.mp4" ^
--filename "vid.mp4" ^
--caption "File description" ^
--quoted "BAE5C8B93FC989C5"
```
</TabItem>
</Tabs>
```json title="Result"
{
"idMessage": "BAE5C8B93FC989C5",
"urlFile": "https://do-mediaout-7105.fra1.digitaloceanspaces.com/7105187566/0ba995d0-5b11-4861-99b5-729204b596d2.jpg"
}
```

View File

@@ -0,0 +1,87 @@
---
sidebar_position: 5
description: Send location and other functions to work with Green API 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, Green API]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Send location
Sends location data to the specified chat room
`Function SendLocation(Val AccessParameters, Val ChatID, Val Location, Val ReplyID = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| AccessParameters | --access | Structure Of KeyAndValue | &#x2714; | Access parameters. See FormAccessParameters |
| ChatID | --chat | String | &#x2714; | Chat identifier |
| Location | --loc | Structure Of KeyAndValue | &#x2714; | Location description. See GetLocationDescription |
| ReplyID | --quoted | String | &#x2716; | Replying message id if necessary |
Returns: Map Of KeyAndValue - serialized JSON response from Green API
<br/>
:::tip
Method at API documentation: [SendPoll](https://green-api.com/docs/api/sending/SendPoll/)
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
ApiUrl = "https://7105.api.greenapi.com";
MediaUrl = "https://7105.media.greenapi.com";
IdInstance = "71051...";
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
ChatID = "120363410406221140@g.us";
Latitude = 53.908522;
Longitude = 27.574821;
Address = "Victory Square, Minsk";
Name = "Victory sq.";
Location = OPI_GreenAPI.GetLocationDescription(Latitude, Longitude, Address, Name);
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenAPI.SendLocation(AccessParameters, ChatID, Location);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
# JSON data can also be passed as a path to a .json file
oint greenapi SendLocation \
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" \
--chat "120363410406221140@g.us" \
--loc "{'latitude':53.908522,'longitude':27.574821}" \
--quoted "BAE577BB1B8B1F9D"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
:: JSON data can also be passed as a path to a .json file
oint greenapi SendLocation ^
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" ^
--chat "120363410406221140@g.us" ^
--loc "{'latitude':53.908522,'longitude':27.574821}" ^
--quoted "BAE577BB1B8B1F9D"
```
</TabItem>
</Tabs>
```json title="Result"
{
"idMessage": "BAE521F83EFFA9B9"
}
```

View File

@@ -0,0 +1,92 @@
---
sidebar_position: 4
description: Send poll and other functions to work with Green API 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, Green API]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Send poll
Sends a poll with answer choices to the selected chat room
`Function SendPoll(Val AccessParameters, Val ChatID, Val Text, Val Options, Val MultipleSelect = False, Val ReplyID = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| AccessParameters | --access | Structure Of KeyAndValue | &#x2714; | Access parameters. See FormAccessParameters |
| ChatID | --chat | String | &#x2714; | Chat identifier |
| Text | --text | String | &#x2714; | Message text |
| Options | --options | Array Of String | &#x2714; | Answer options |
| MultipleSelect | --multi | Boolean | &#x2716; | Allows to select more than one answer choice |
| ReplyID | --quoted | String | &#x2716; | Replying message id if necessary |
Returns: Map Of KeyAndValue - serialized JSON response from Green API
<br/>
:::tip
Method at API documentation: [SendPoll](https://green-api.com/docs/api/sending/SendPoll/)
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
ApiUrl = "https://7105.api.greenapi.com";
MediaUrl = "https://7105.media.greenapi.com";
IdInstance = "71051...";
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
ChatID = "120363410406221140@g.us";
Text = "What's your favorite color?";
Options = New Array;
Options.Add("Red");
Options.Add("Yellow");
Options.Add("Green");
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenAPI.SendPoll(AccessParameters, ChatID, Text, Options);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
# JSON data can also be passed as a path to a .json file
oint greenapi SendPoll \
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" \
--chat "120363410406221140@g.us" \
--text "What's your favorite color?" \
--options "['Red','Yellow','Green']" \
--multi true \
--quoted "BAE5DD19A53A74E2"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
:: JSON data can also be passed as a path to a .json file
oint greenapi SendPoll ^
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" ^
--chat "120363410406221140@g.us" ^
--text "What's your favorite color?" ^
--options "['Red','Yellow','Green']" ^
--multi true ^
--quoted "BAE5DD19A53A74E2"
```
</TabItem>
</Tabs>
```json title="Result"
{
"idMessage": "BAE50A8D8935805F"
}
```

View File

@@ -0,0 +1,81 @@
---
sidebar_position: 1
description: Send text message and other functions to work with Green API 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, Green API]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Send text message
Sends a text message to the selected chat room
`Function SendTextMessage(Val AccessParameters, Val ChatID, Val Text, Val ReplyID = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| AccessParameters | --access | Structure Of KeyAndValue | &#x2714; | Access parameters. See FormAccessParameters |
| ChatID | --chat | String | &#x2714; | Chat identifier |
| Text | --text | String | &#x2714; | Message text |
| ReplyID | --quoted | String | &#x2716; | Replying message id if necessary |
Returns: Map Of KeyAndValue - serialized JSON response from Green API
<br/>
:::tip
Method at API documentation: [SendMessage](https://green-api.com/docs/api/sending/SendMessage/)
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
ApiUrl = "https://7105.api.greenapi.com";
MediaUrl = "https://7105.media.greenapi.com";
IdInstance = "71051...";
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
ChatID = "120363410406221140@g.us";
Text = "New message";
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenAPI.SendTextMessage(AccessParameters, ChatID, Text);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
# JSON data can also be passed as a path to a .json file
oint greenapi SendTextMessage \
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" \
--chat "120363410406221140@g.us" \
--text "New message" \
--quoted "BAE5B8457AE5FC88"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
:: JSON data can also be passed as a path to a .json file
oint greenapi SendTextMessage ^
--access "{'apiUrl':'***','mediaUrl':'https://7105.media.greenapi.com','idInstance':'7105187566','apiTokenInstance':'***'}" ^
--chat "120363410406221140@g.us" ^
--text "New message" ^
--quoted "BAE5B8457AE5FC88"
```
</TabItem>
</Tabs>
```json title="Result"
{
"idMessage": "BAE5B8457AE5FC88"
}
```

View File

@@ -0,0 +1,4 @@
{
"label": "Message sending",
"position": "4"
}