rsnhah
rsnhah

Reputation: 359

Slack incoming webhook vs postMessage Web API

What is the difference between incoming webhook and slack chat.postMessage webAPI?

When should we use one over another? I have a slack app, I want to send messages to particular channel as a User. I found an option to post message as a User in chat.postMessage, can I achieve this by incoming webhook?

Upvotes: 3

Views: 1289

Answers (1)

Erik Kalkoken
Erik Kalkoken

Reputation: 32854

To your specific question. Its technically possible to send messages on behalf of a user with chat.postMessage by using a token from that user and setting as_user to true.

For example if you installed a Slack app the created app token will be linked to the installing user and you can use it send messages on behalf of the installing user.

Upvotes: 4

Related Questions