Reputation: 16724
I use the following to post to Slack's incoming Webhook:
slack_incoming_webhook = 'URL....."
payload={
"text"=> bot_response[:bot_response],
"channel"=>"@mememem"
}
jsonresponse = RestClient.post slack_incoming_webhook, payload, :content_type => 'application/json'
I get the following error:
RestClient::InternalServerError: 500 Internal Server Error
The post appears to be posting correctly when I check it on request_bin, so I am unclear how to resolve this error.
Upvotes: 1
Views: 4374
Reputation: 2469
Try
require 'json'
payload={
"text"=> bot_response[:bot_response],
"channel"=>"@mememem"
}.to_json
Upvotes: 1