Rking14
Rking14

Reputation: 345

Slack API file.upload to a user?

I'm trying to follow the tutorial found here https://api.slack.com/methods/files.upload .

curl -F [email protected] -F "initial_comment=I play the drums." -F channels=C024BE91L -F thread_ts=1532293503.000001 -H "Authorization: Bearer xoxp-xxxxxxxxx-xxxx" https://slack.com/api/files.upload

I'm able to upload files to a specific channel. However, how do I upload files to a user through direct message?

Upvotes: 1

Views: 839

Answers (1)

Erik Kalkoken
Erik Kalkoken

Reputation: 32698

Similar to how sending direct messages work you can simply use the user ID for the channel and the file will be uploaded in a direct message channel between that user and the owner of the token.

Alternatively you can first open a direct message channel from your app with im.open and then use the channel ID of that IM in files.upload.

Upvotes: 2

Related Questions