Solved

Slack webhook returns response 400

  • 3 May 2023
  • 3 replies
  • 103 views

Badge +4

Good afternoon.

I have set up the Slack Webhook as per the instructions but whenever I send a test webhook or also with the test purchases in the sandbox, I always get a response 400.

The curl hello world from the Slack page works perfectly and I can see the message in my Slack channel.

Perhaps something has changed in the way Slack expects the messages to be formatted? In the sent json I don’t see the “text” field that I see in the Slack test webhook.

Thanks a lot.

icon

Best answer by Haley Pace 23 May 2023, 00:26

View original

3 replies

Badge +4

Well actually I am stupid. I was using a normal Webhook instead of the Slack Webhook in the integration page. So mystery solved, my bad.

Badge +4

I have just followed the instructions for the integration, so I don’t think my set-up is of any difference.

 

What I meant by the Slack curl example is that the message they sent is the following:

POST https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
Content-type: application/json
{
"text": "Hello, world."
}

I though they might have change the messages that they expect. 

I will anyway check my integration and see if there is anything wrong there. Thanks

Userlevel 4
Badge +8

Hi, not too sure what this could be without actually seeing your integration, but generally 400s mean that the webhooks RevenueCat are sending are not being accepted. Here is the following format that the Slack webhooks we send are in:

{
"app_id": 12345,
"payload": {
"attachments": [
{
"color": "#30B296",
"fallback": "Customer user_id just renewed their subscription of product_name",
"fields": [
{
"value": ":smiley_cat: Customer <customer_history_url> just renewed their subscription."
},
{
"short": false,
"title": "Product",
"value": "product_name"
},
{
"short": false,
"title": "Revenue",
"value": "$4.99"
}
],
"ts": 1684691858
}
],
"channel": "notification_revenuecat",
"icon_url": "https://app.revenuecat.com/favicon-96x96.png",
"username": "RevenueCat"
},
"product_identifier": "product_name"
}

 

Reply