Skip to main content

Get list of files

Gets a list of files of the bot or channel

Function GetFilesList(Val Token, Val Channel = "", Val PageNumber = 1) Export

ParameterCLI optionTypeDescription
Token--tokenStringBot token
Channel--channelStringChannel for selection
PageNumber--pageNumber, StringPage number

Returns: Map Of KeyAndValue - Serialized JSON response from Slack


Code example
  
PageNumber = 1;
Channel = "C123456";

Response = OPI_Slack.GetFilesList(Token, Channel, PageNumber); //Map
Response = OPI_Tools.JSONString(Response); //JSON string
CLI command example
    
oint slack GetFilesList --token %token% --channel "C123456" --page "1"

Result
{
"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
}
]
}