Sending JSON to Slack in a HTTP POST request

后端 未结 11 733
隐瞒了意图╮
隐瞒了意图╮ 2020-12-24 05:21

I\'m trying to send a message using Slack\'s chat.postMessage API call. I have no problems encoding my test messages within HTTP GET, but I\'m trying to achieve the same res

11条回答
  •  时光说笑
    2020-12-24 05:53

    As of March 2018, Slack now supports POST with JSON body

    Endpoint: https://slack.com/api/chat.postMessage

    Headers: Authorization: Bearer xoxp-your-hardly-find-token-here

    Body: {"channel":"CH9NN37","text":"something from me!"}

    Notice the Bearer in the Authorization header.

提交回复
热议问题