filesSharedPublicUrl
Enables a file for public/external sharing.
Details
- Method:
POST - Path:
/files.sharedPublicURL - Operation ID:
files_sharedPublicURL
Parameters
{
"token": {
"description": "Authentication token. Requires scope: `files:write:user`",
"required": false,
"location": "header",
"type": "string"
},
"file": {
"description": "File to share",
"required": false,
"location": "formData",
"type": "string"
}
}Response Schema
{
"additionalProperties": false,
"description": "Schema for successful response from files.sharedPublicURL method",
"properties": {
"file": {
"additionalProperties": false,
"properties": {
"channels": {
"items": {
"pattern": "^[C][A-Z0-9]{2,}$",
"title": "Channel ID",
"type": "string"
},
"type": "array",
"uniqueItems": true
},
"comments_count": {
"type": "integer"
},
"created": {
"type": "integer"
},
"date_delete": {
"type": "integer"
},
"display_as_bot": {
"type": "boolean"
},
"editable": {
"type": "boolean"
},
"editor": {
"pattern": "^[UW][A-Z0-9]{2,}$",
"title": "User ID",
"type": "string"
},
"external_id": {
"type": "string"
},
"external_type": {
"type": "string"
},
"external_url": {
"format": "uri",
"type": "string"
},
"filetype": {
"type": "string"
},
"groups": {
"items": {
"pattern": "^[G][A-Z0-9]{8,}$",
"title": "Private Channel ID",
"type": "string"
},
"type": "array",
"uniqueItems": true
},
"has_rich_preview": {
"type": "boolean"
},
"id": {
"pattern": "^[F][A-Z0-9]{8,}$",
"title": "File ID",
"type": "string"
},
"image_exif_rotation": {
"type": "integer"
},
"ims": {
"items": {
"pattern": "^[D][A-Z0-9]{8,}$",
"title": "Direct Message Channel ID",
"type": "string"
},
"type": "array",
"uniqueItems": true
},
"is_external": {
"type": "boolean"
},
"is_public": {
"type": "boolean"
},
"is_starred": {
"type": "boolean"
},
"is_tombstoned": {
"type": "boolean"
},
"last_editor": {
"pattern": "^[UW][A-Z0-9]{2,}$",
"title": "User ID",
"type": "string"
},
"mimetype": {
"type": "string"
},
"mode": {
"type": "string"
},
"name": {
"type": "string"
},
"non_owner_editable": {
"type": "boolean"
},
"num_stars": {
"type": "integer"
},
"original_h": {
"type": "integer"
},
"original_w": {
"type": "integer"
},
"permalink": {
"format": "uri",
"type": "string"
},
"permalink_public": {
"format": "uri",
"type": "string"
},
"pinned_info": {
"additionalProperties": false,
"title": "Info for a pinned item",
"type": "object"
},
"pinned_to": {
"items": {
"pattern": "^[CGD][A-Z0-9]{8,}$",
"title": "Channel-like conversation ID",
"type": "string"
},
"type": "array"
},
"pretty_type": {
"type": "string"
},
"preview": {
"type": "string"
},
"public_url_shared": {
"type": "boolean"
},
"reactions": {
"items": {
"additionalProperties": true,
"properties": {
"count": {
"type": "integer"
},
"name": {
"type": "string"
},
"users": {
"items": {
"pattern": "^[UW][A-Z0-9]{2,}$",
"title": "User ID",
"type": "string"
},
"type": "array"
}
},
"required": [
"name",
"users",
"count"
],
"title": "Reaction object",
"type": "object"
},
"type": "array"
},
"shares": {
"additionalProperties": false,
"properties": {
"private": {
"additionalProperties": false
},
"public": {
"additionalProperties": false
}
},
"type": "object"
},
"size": {
"type": "integer"
},
"source_team": {
"pattern": "^[T][A-Z0-9]{2,}$",
"title": "Team ID",
"type": "string"
},
"state": {
"type": "string"
},
"thumb_1024": {
"format": "uri",
"type": "string"
},
"thumb_1024_h": {
"type": "integer"
},
"thumb_1024_w": {
"type": "integer"
},
"thumb_160": {
"format": "uri",
"type": "string"
},
"thumb_360": {
"format": "uri",
"type": "string"
},
"thumb_360_h": {
"type": "integer"
},
"thumb_360_w": {
"type": "integer"
},
"thumb_480": {
"format": "uri",
"type": "string"
},
"thumb_480_h": {
"type": "integer"
},
"thumb_480_w": {
"type": "integer"
},
"thumb_64": {
"format": "uri",
"type": "string"
},
"thumb_720": {
"format": "uri",
"type": "string"
},
"thumb_720_h": {
"type": "integer"
},
"thumb_720_w": {
"type": "integer"
},
"thumb_80": {
"format": "uri",
"type": "string"
},
"thumb_800": {
"format": "uri",
"type": "string"
},
"thumb_800_h": {
"type": "integer"
},
"thumb_800_w": {
"type": "integer"
},
"thumb_960": {
"format": "uri",
"type": "string"
},
"thumb_960_h": {
"type": "integer"
},
"thumb_960_w": {
"type": "integer"
},
"thumb_tiny": {
"type": "string"
},
"timestamp": {
"type": "integer"
},
"title": {
"type": "string"
},
"updated": {
"type": "integer"
},
"url_private": {
"format": "uri",
"type": "string"
},
"url_private_download": {
"format": "uri",
"type": "string"
},
"user": {
"type": "string"
},
"user_team": {
"pattern": "^[T][A-Z0-9]{2,}$",
"title": "Team ID",
"type": "string"
},
"username": {
"type": "string"
}
},
"title": "file object",
"type": "object"
},
"ok": {
"enum": [
true
],
"title": "default success response",
"type": "boolean"
}
},
"required": [
"ok",
"file"
],
"title": "files.sharedPublicURL schema",
"type": "object"
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('slack')
# Call this tool
result = await agent.call_tool('filesSharedPublicUrl', {
# Add required parameters here
})