I am attempting to create an integration between RingCentral and Airtable by registering a webhook on RingCentral that will be triggered on specific events (such as receiving messages). The endpoint I want to use is hosted on Airtable, and I am using RingCentral's Subscription API to create the webhook subscription.
Details:
Airtable Webhook URL: The webhook URL I want to register with RingCentral is https://hooks.airtable.com/workflows/v1/genericWebhook/xxxxxxxx [Truncated the URL for privacy reasons].
RingCentral Subscription API: I am utilizing RingCentral's Subscription API to create the webhook. I have provided the eventFilters that are relevant to my use-case and specified the transportType as WebHook.
Error Encountered: When I attempt to register the webhook, I receive the following error message:
"Error status: 400, Error message: {"errorCode":"SUB-522","message":"WebHook responds with incorrect HTTP status. HTTP status is 400","errors":[{"errorCode":"SUB-522","message":"WebHook responds with incorrect HTTP status. HTTP status is 400","status":"400"}],"status":"400"}"
Authentication: I am authenticating using JWT, and the token generation part seems to be working fine. The issue arises when I try to register the webhook.
Code Used: Below is the simplified code snippet that represents the webhook registration process:
// ... Authentication code ...
let webhookUrl = 'https://hooks.airtable.com/...'; // Airtable webhook URL
let registerWebhookUrl = `${server}/restapi/v1.0/subscription`;
let webhookResponse = await fetch(registerWebhookUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + accessToken
},
body: JSON.stringify({
eventFilters: [
'/restapi/v1.0/account/~/extension/~/message-store'
],
deliveryMode: {
transportType: 'WebHook',
address: webhookUrl
}
})
});
// Error handling code ...
Questions:
- Is there something specific about the Airtable webhook URL that might be causing this issue?
- Are there additional headers or parameters required for registering a webhook with RingCentral using an Airtable URL?
- Has anyone else experienced a similar issue and found a solution or workaround?
I appreciate any insights or guidance on resolving this issue. Thank you!