You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-11-29 22:27:42 +02:00
61 lines
2.2 KiB
Plaintext
Vendored
61 lines
2.2 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 3
|
|
description: Send file by URL 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 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 TypingTime = 0, Val TypingType = "file") Export`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| AccessParameters | --access | Structure Of KeyAndValue | ✔ | Access parameters. See FormAccessParameters |
|
|
| ChatID | --chat | String | ✔ | Chat identifier |
|
|
| FileURL | --url | String | ✔ | File URL |
|
|
| FileName | --filename | String | ✔ | Name of the file with the extension |
|
|
| Description | --caption | String | ✖ | Message text below the file |
|
|
| TypingTime | --typing | Number | ✖ | Time to show typing indicator before sending (in ms.) |
|
|
| TypingType | --ttype | String | ✖ | Typing type: text, recording, video, image, file |
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Green API
|
|
|
|
<br/>
|
|
|
|
:::tip
|
|
Method at API documentation: [SendFileByUrl](https://green-api.com/v3/docs/api/sending/SendFileByUrl/)
|
|
:::
|
|
<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...";
|
|
|
|
File = "https://hut.openintegrations.dev/test_data/picture.jpg";
|
|
FileName = "photo.jpg";
|
|
ChatID = 12345678;
|
|
Description = "File description";
|
|
|
|
AccessParameters = OPI_GreenMax.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
|
Result = OPI_GreenMax.SendFileByURL(AccessParameters, ChatID, File, FileName);
|
|
```
|
|
|
|
|
|
|
|
|
|
```json title="Result"
|
|
{
|
|
"idMessage": "2761560461069"
|
|
}
|
|
```
|