Skip to main content
Solved

Slack webhook returns response 400


Forum|alt.badge.img+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.

Best answer by Haley Pace

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"
  }

 

View original
Did this post help you find an answer to your question?

3 replies

Forum|alt.badge.img+8
  • RevenueCat Staff
  • 418 replies
  • Answer
  • May 22, 2023

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"
  }

 


Forum|alt.badge.img+4
  • Author
  • New Member
  • 4 replies
  • May 23, 2023

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


Forum|alt.badge.img+4
  • Author
  • New Member
  • 4 replies
  • May 23, 2023

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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings