1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-04-27 12:32:33 +02:00
OpenIntegrations/docs/en/md/Slack/File-managment/Make-file-private.mdx

98 lines
2.2 KiB
Plaintext
Raw Normal View History

2024-10-15 10:50:56 +03:00
---
2024-10-15 10:16:04 +03:00
sidebar_position: 6
---
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
# Make file private
Removes the public URL from the file. Requires user token
`Function MakeFilePrivate(Val Token, Val FileID) Export`
2024-10-15 15:15:47 +03:00
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | User token |
| FileID | --fileid | String | ✔ | File identifier |
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"
2024-10-15 10:16:04 +03:00
Token = "xoxb-6965308400114-696804637...";
2024-11-11 22:11:22 +03:00
FileID = "F0809V81ZGV";
2024-10-15 10:16:04 +03:00
Result = OPI_Slack.MakeFilePrivate(Token, FileID);
```
2024-10-20 22:36:03 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint slack MakeFilePrivate \
2024-10-22 08:59:24 +03:00
--token "***" \
2024-11-17 16:09:58 +03:00
--fileid "F0817CANNUB"
2024-10-20 22:36:03 +03:00
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint slack MakeFilePrivate ^
2024-10-22 08:59:24 +03:00
--token "***" ^
2024-11-17 16:09:58 +03:00
--fileid "F0817CANNUB"
2024-10-20 22:36:03 +03:00
```
</TabItem>
</Tabs>
2024-10-15 10:16:04 +03:00
```json title="Result"
{
"ok": true,
"files": [
{
"id": "F07QV0PCS1L",
"created": 1728454525,
"timestamp": 1728454525,
"name": "megadoc.docx",
"title": "NewFile",
"mimetype": "",
"filetype": "",
"pretty_type": "",
"user": "U06UG1CAYH2",
"user_team": "T06UD92BS3C",
"editable": false,
"size": 24069,
"mode": "hosted",
"is_external": false,
"external_type": "",
"is_public": false,
"public_url_shared": false,
"display_as_bot": false,
"username": "",
"url_private": "https://files.slack.com/files-pri/T06UD92BS3C-F07QV0PCS1L/megadoc.docx",
"url_private_download": "https://files.slack.com/files-pri/T06UD92BS3C-F07QV0PCS1L/download/megadoc.docx",
"media_display_type": "unknown",
"permalink": "https://openintegrationsgroup.slack.com/files/U06UG1CAYH2/F07QV0PCS1L/megadoc.docx",
"permalink_public": "https://slack-files.com/T06UD92BS3C-F07QV0PCS1L-dec85076a5",
"comments_count": 0,
"is_starred": false,
"shares": {},
"channels": [],
"groups": [],
"ims": [],
"has_more_shares": false,
"has_rich_preview": false,
"file_access": "visible"
}
]
}
```