1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-06-02 23:27:50 +02:00
2024-09-29 17:27:25 +03:00

2.0 KiB

sidebar_position
sidebar_position
3

Add external file

Adds a new external file

Function AddExternalFile(Val Token, Val URL, Val Title) Export

Parameter CLI option Type 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


    Token = "xoxb-6965308400114-696804637...";
    Title = "NewFile";
    File  = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/document.docx"; // URL, Binary Data or Path to file

    Result = OPI_Slack.AddExternalFile(Token, File, Title);
    
  oint slack AddExternalFile --token %token% --url "https://opi.neocities.org/test_data/document.docx" --title %title%

{
  "ok": true,
  "file": {
  "id": "F070P52CU94",
  "created": 1714146552,
  "timestamp": 1714146552,
  "name": "Novyj_fajl",
  "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": "",
  "url_private": "https://slack.com/api/files.remote.add",
  "media_display_type": "unknown",
  "permalink": "https://openintegrationsgroup.slack.com/files/U06UG1CAYH2/F070P52CU94/novyj_fajl",
  "comments_count": 0,
  "is_starred": false,
  "shares": {},
  "channels": [],
  "groups": [],
  "ims": [],
  "has_more_shares": false,
  "external_id": "d2a110a2-08eb-4f20-989f-8943f0816420",
  "external_url": "https://slack.com/api/files.remote.add",
  "has_rich_preview": false,
  "file_access": "visible"
  }
  }