1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-12-01 22:29:52 +02:00
Files
OpenIntegrations/docs/en/md/Slack/External-files-management/Add-external-file.mdx

102 lines
2.7 KiB
Plaintext
Raw Normal View History

2024-10-15 10:50:56 +03:00
---
2024-10-15 10:16:04 +03:00
sidebar_position: 3
2025-05-05 11:15:20 +03:00
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
2025-05-05 09:49:19 +03:00
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Slack]
2024-10-15 10:16:04 +03:00
---
2024-10-15 10:50:56 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2024-10-15 10:16:04 +03:00
# Add external file
Adds a new external file
`Function AddExternalFile(Val Token, Val URL, Val Title) Export`
2024-10-15 15:15:47 +03:00
| 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 |
2024-10-15 10:16:04 +03:00
Returns: Map Of KeyAndValue - serialized JSON response from Slack
<br/>
2024-10-15 21:15:56 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2025-10-21 11:36:43 +03:00
Token = "xoxb-6965308400114-696804637...";
2024-10-15 10:16:04 +03:00
Title = "NewFile";
2025-10-21 11:36:43 +03:00
File = "https://hut.openintegrations.dev/test_data/document.docx";
2024-10-15 10:16:04 +03:00
Result = OPI_Slack.AddExternalFile(Token, File, Title);
```
2024-10-20 22:36:03 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint slack AddExternalFile \
2024-10-22 08:59:24 +03:00
--token "***" \
2025-07-05 18:56:59 +03:00
--url "https://hut.openintegrations.dev/test_data/document.docx" \
2024-10-22 08:59:24 +03:00
--title "NewFile"
2024-10-20 22:36:03 +03:00
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint slack AddExternalFile ^
2024-10-22 08:59:24 +03:00
--token "***" ^
2025-07-05 18:56:59 +03:00
--url "https://hut.openintegrations.dev/test_data/document.docx" ^
2024-10-22 08:59:24 +03:00
--title "NewFile"
2024-10-20 22:36:03 +03:00
```
</TabItem>
</Tabs>
2024-10-15 10:16:04 +03:00
```json title="Result"
{
"ok": true,
"file": {
2025-10-15 14:32:00 +03:00
"id": "F09LEMVED4K",
"created": 1760521375,
"timestamp": 1760521375,
2024-10-15 10:16:04 +03:00
"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": "",
2025-10-15 14:32:00 +03:00
"external_id": "561a6a87-2cb6-43c0-bb0a-cb2a81e337ec",
2025-09-12 20:23:31 +03:00
"external_url": "https://hut.openintegrations.dev/test_data/document.docx",
"url_private": "https://hut.openintegrations.dev/test_data/document.docx",
2024-10-15 10:16:04 +03:00
"media_display_type": "unknown",
2025-10-15 14:32:00 +03:00
"permalink": "https://openintegrationsgroup.slack.com/files/U06UG1CAYH2/F09LEMVED4K/newfile",
2024-10-15 10:16:04 +03:00
"comments_count": 0,
"is_starred": false,
"shares": {},
"channels": [],
"groups": [],
"ims": [],
"has_more_shares": false,
2025-09-12 20:23:31 +03:00
"app_id": "A06TYNH45RV",
2024-10-15 10:16:04 +03:00
"has_rich_preview": false,
"file_access": "visible"
}
}
```