Hey everyone,
I’m trying to create a POST Webhook that changes the subscription status of a user and can’t seem to get it to work properly as it’s returning a 404 Error.
Using the API Docs on Intercom’s website: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/Subscription-Types/attachSubscriptionTypeToContact/
I can see that I need the following in the Request:
- Path (URL): contact_id
- Header: Intercom_Version
- Body: id and consent_type
Furthermore, when I play with their request, I see the body needs to be formatted in the following way:
{
"id": xxx,
"consent_type": "opt_in"
}
--
I’ve created a webhook with the following attributes:
However, this produces a 404 Error.
--
I also tried to replicate this error using a Custom Action and got the same 404 Error.
This was the Test Action:
Here is the API Response:
{
"request": {
"method": "POST",
"url": "https://api.intercom.io/contacts/64c40752d7dde5e6aadd2569/subscriptions",
"querystring": null,
"headers": {
"intercom-version": "2.10"
},
"body": "{\n \"id\": 425411,\n \"consent_type\": \"opt_in\"\n}",
"data": {
"id": 425411,
"consent_type": "opt_in"
}
},
"response": {
"status": 404,
"headers": {
"cache-control": "no-cache",
"connection": "close",
"content-encoding": "gzip",
"content-type": "application/json; charset=utf-8",
"date": "Tue, 26 Dec 2023 20:42:59 GMT",
"intercom-version": "2.10",
"server": "nginx",
"status": "404 Not Found",
"strict-transport-security": "max-age=31556952; includeSubDomains; preload",
"transfer-encoding": "chunked",
"vary": "Accept,Accept-Encoding",
"x-content-type-options": "nosniff",
"x-frame-options": "SAMEORIGIN",
"x-intercom-version": "d1024b8887aeffd88c15715f3464730c3e6e7d38",
"x-ratelimit-limit": "1667",
"x-ratelimit-remaining": "1667",
"x-ratelimit-reset": "1703623382",
"x-request-id": "000de73ve7kkr673ut40",
"x-request-queueing": "0",
"x-runtime": "0.059473",
"x-xss-protection": "1; mode=block"
},
"body": "{\"type\":\"error.list\",\"request_id\":\"000de73ve7kkr673ut40\",\"errors\": {\"code\":\"not_found\",\"message\":\"Resource Not Found\"}]}",
"data": {
"type": "error.list",
"request_id": "000de73ve7kkr673ut40",
"errors": r
{
"code": "not_found",
"message": "Resource Not Found"
}
]
}
}
}
--
I’m wondering if it has anything to do with the \n line breaks in the body, but I’m not sure.
Any help would be appreciated.