2024-06-07 13:53:24 +02:00
|
|
|
---
|
|
|
|
sidebar_position: 1
|
|
|
|
---
|
|
|
|
|
|
|
|
# Get list of files
|
|
|
|
Gets a list of files of the bot or channel
|
|
|
|
|
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
`Function GetFilesList(Val Token, Val Channel = "", Val PageNumber = 1) Export`
|
2024-06-07 13:53:24 +02:00
|
|
|
|
|
|
|
| Parameter | CLI option | Type | Destination |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Token | --token | String | Bot token |
|
|
|
|
| Channel | --channel | String | Channel for selection |
|
|
|
|
| PageNumber | --page | Number, String | Page number |
|
|
|
|
|
|
|
|
|
|
|
|
Returns: Map Of KeyAndValue - Serialized JSON response from Slack
|
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-07 13:53:24 +02:00
|
|
|
```bsl title="Code example"
|
|
|
|
|
|
|
|
PageNumber = 1;
|
|
|
|
Channel = "C123456";
|
|
|
|
|
|
|
|
Response = OPI_Slack.GetFilesList(Token, Channel, PageNumber); //Map
|
|
|
|
Response = OPI_Tools.JSONString(Response); //JSON string
|
|
|
|
|
|
|
|
```
|
2024-07-10 10:59:55 +02:00
|
|
|
|
|
|
|
|
2024-06-07 13:53:24 +02:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
|
|
|
|
|
|
|
oint slack GetFilesList --token %token% --channel "C123456" --page "1"
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-07-10 10:59:55 +02:00
|
|
|
{
|
2024-06-07 13:53:24 +02:00
|
|
|
"ok": true,
|
|
|
|
"files": [
|
|
|
|
{
|
|
|
|
"id": "F070V4U7Y4R",
|
|
|
|
"created": 1713978714,
|
|
|
|
"timestamp": 1713978714,
|
|
|
|
"name": "megadoc.docx",
|
|
|
|
"title": "NewFile",
|
|
|
|
"mimetype": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
|
|
"filetype": "docx",
|
|
|
|
"pretty_type": "Word Document",
|
|
|
|
"user": "U06UG1CAYH2",
|
|
|
|
"user_team": "T06UD92BS3C",
|
|
|
|
"editable": false,
|
|
|
|
"size": 24069,
|
|
|
|
"mode": "hosted",
|
|
|
|
"is_external": false,
|
|
|
|
"external_type": "",
|
|
|
|
"is_public": true,
|
|
|
|
"public_url_shared": false,
|
|
|
|
"display_as_bot": false,
|
|
|
|
"username": "",
|
|
|
|
"url_private": "https://files.slack.com/files-pri/T06UD92BS3C-F070V4U7Y4R/megadoc.docx",
|
|
|
|
"url_private_download": "https://files.slack.com/files-pri/T06UD92BS3C-F070V4U7Y4R/download/megadoc.docx",
|
|
|
|
"media_display_type": "unknown",
|
|
|
|
"converted_pdf": "https://files.slack.com/files-tmb/T06UD92BS3C-F070V4U7Y4R-417b34221e/megadoc_converted.pdf",
|
|
|
|
"thumb_pdf": "https://files.slack.com/files-tmb/T06UD92BS3C-F070V4U7Y4R-417b34221e/megadoc_thumb_pdf.png",
|
|
|
|
"thumb_pdf_w": 909,
|
|
|
|
"thumb_pdf_h": 1286,
|
|
|
|
"permalink": "https://openintegrationsgroup.slack.com/files/U06UG1CAYH2/F070V4U7Y4R/megadoc.docx",
|
|
|
|
"channels": [
|
|
|
|
"C06UFNUTKUL"
|
|
|
|
],
|
|
|
|
"groups": [],
|
|
|
|
"ims": [],
|
|
|
|
"comments_count": 0
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|