1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-27 22:18:36 +02:00
Files
OpenIntegrations/docs/en/md/Slack/External-files-management/Add-external-file.mdx
Vitaly the Alpaca (bot) 1120c732f0 Main build (Jenkins)
2025-10-20 19:41:52 +03:00

102 lines
2.7 KiB
Plaintext
Vendored

---
sidebar_position: 3
description: Add external file and other functions to work with Slack 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, Slack]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Add external file
Adds a new external file
`Function AddExternalFile(Val Token, Val URL, Val Title) Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Bot token |
| URL | --url | String | ✔ | URL to external file |
| Title | --title | String | ✔ | File title for Slack |
Returns: Map Of KeyAndValue - serialized JSON response from Slack
<br/>
```bsl title="1C:Enterprise/OneScript code example"
Token = FunctionParameters["Slack_Token"];
Title = "NewFile";
File = FunctionParameters["Document"];
Result = OPI_Slack.AddExternalFile(Token, File, Title);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint slack AddExternalFile \
--token "***" \
--url "https://hut.openintegrations.dev/test_data/document.docx" \
--title "NewFile"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint slack AddExternalFile ^
--token "***" ^
--url "https://hut.openintegrations.dev/test_data/document.docx" ^
--title "NewFile"
```
</TabItem>
</Tabs>
```json title="Result"
{
"ok": true,
"file": {
"id": "F09LEMVED4K",
"created": 1760521375,
"timestamp": 1760521375,
"name": "NewFile",
"title": "NewFile",
"mimetype": "application/vnd.slack-remote",
"filetype": "remote",
"pretty_type": "Remote",
"user": "U06UG1CAYH2",
"user_team": "T06UD92BS3C",
"editable": false,
"size": 0,
"mode": "external",
"is_external": true,
"external_type": "app",
"is_public": false,
"public_url_shared": false,
"display_as_bot": false,
"username": "",
"external_id": "561a6a87-2cb6-43c0-bb0a-cb2a81e337ec",
"external_url": "https://hut.openintegrations.dev/test_data/document.docx",
"url_private": "https://hut.openintegrations.dev/test_data/document.docx",
"media_display_type": "unknown",
"permalink": "https://openintegrationsgroup.slack.com/files/U06UG1CAYH2/F09LEMVED4K/newfile",
"comments_count": 0,
"is_starred": false,
"shares": {},
"channels": [],
"groups": [],
"ims": [],
"has_more_shares": false,
"app_id": "A06TYNH45RV",
"has_rich_preview": false,
"file_access": "visible"
}
}
```