You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-12-01 22:29:52 +02:00
57 lines
1.8 KiB
Plaintext
Vendored
57 lines
1.8 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 1
|
|
description: Send text message and other functions to work with GreenMax 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, GreenMax]
|
|
---
|
|
|
|
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 TypingTime = 0) Export`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| AccessParameters | --access | Structure Of KeyAndValue | ✔ | Access parameters. See FormAccessParameters |
|
|
| ChatID | --chat | String | ✔ | Chat identifier |
|
|
| Text | --text | String | ✔ | Message text |
|
|
| TypingTime | --typing | Number | ✖ | Time to show the typing indicator before sending (in ms.) |
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Green API
|
|
|
|
<br/>
|
|
|
|
:::tip
|
|
Method at API documentation: [SendMessage](https://green-api.com/v3/docs/api/sending/SendMessage/)
|
|
:::
|
|
<br/>
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
ApiUrl = "https://3100.api.green-api.com/v3";
|
|
MediaUrl = "https://3100.api.green-api.com/v3";
|
|
IdInstance = "31003...";
|
|
ApiTokenInstance = "17915d8e0b4b4975a183478da...";
|
|
|
|
Text = "Message text";
|
|
ChatID = 12345678;
|
|
Set = 2000;
|
|
|
|
AccessParameters = OPI_GreenMax.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
|
Result = OPI_GreenMax.SendTextMessage(AccessParameters, ChatID, Text, Set);
|
|
```
|
|
|
|
|
|
|
|
|
|
```json title="Result"
|
|
{
|
|
"idMessage": "2761560453818"
|
|
}
|
|
```
|