โ01-22-2024 01:09 AM
Hi, teams. I want to use [Send request via HTTP]App to send messages to the Slack incoming webhook.Since icon_emoji and username are required, I am using HTTP request instead of Slack Post APP.I have completed setting up an incoming webhook in Slack and completed setting up Connection in Workato.
When I run it, I can send text to Slack, but for some reason the recipe causes an error. It says it's a JSON error, but I have no idea. Does anyone know the cause?
{
"request_name": "Send request",
"request": {
"method": "POST",
"content_type": "application/json",
"url": "https://hooks.slack.com/services/XXXXXXXX/XXXXXXXXXXX/AAAAAAAAAAAAAAAAAAA",
"body": "{\"text\": \"Test for sending to Slack \", \"username\": \"Grey Kitty\", \"icon_emoji\": \":sendai:\"}"
},
"response": {
"output_type": "json",
"expected_encoding": "UTF-8",
"ignore_http_errors": "false"
}
}
Error
unexpected token at 'ok'
Debug
NETWORK TRACE
POST
200 https://hooks.slack.com/services/XXXXXXXX/XXXXXXXXXXX/AAAAAAAAAAAAAAAAAAA
Solved! Go to Solution.
โ01-24-2024 01:23 AM
The issue has been resolved.
The problem was due to setting the Response Content Type to JSON in the APP Response section.
Changing it to TEXT resulted in successful completion.
โ01-24-2024 01:23 AM
The issue has been resolved.
The problem was due to setting the Response Content Type to JSON in the APP Response section.
Changing it to TEXT resulted in successful completion.
โ01-24-2024 04:08 PM
Hey @Mieko, thanks for sharing your solution! I'm sure it will be super helpful for anyone else in the community that runs into a similar issue. ๐