Can you upload a file to the Slack API using files.upload as a different user?

There are two ways.

Way 1. - If you only want to upload in a channel and don't need to listen to any conversation, then you can use incoming-webhooks. And then override the username and icon. Read "Customizing your username and icon" in Here.

Way 2 - You can create a bot user and let the bot user type post this message for you. I guess right now you are using test tokens generated by Slack so you are getting your name only. But if you use bot-user then you can use custom Name and icon_url for your bot.

I hope this answers your question.


Yes, as @Abhinav Rai suggested, you need have bot. Slack support just answered me the same question.

To upload files as a bot you'll need to create an associated 'bot user' and post the file using the bot's token: https://api.slack.com/bot-users — all files must be owned by a user account and the bot user will fill this requirement.

Tags:

Slack Api