question

Canberk Soner avatar image
Canberk Soner asked

Info about Webhooks

Hello.

We're using webhooks to stream some event data to another web app. hosted by our company. When creating a webhook, I see the explanation on "post multiple events in JSON array". It says,

"Post multiple events at a time to the webhook in a JSON array instead of posting events individually. Your code should be prepared to handle both multiple and single events."


My question is, when there's a single event, should the server expect a single JSON object in request body, or should it expect an array with just a single event object in it?

webhooks
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

Hi,

First thing you need to know is, batching is required for all new webhooks and cannot be disabled once enabled if you checked “Post multiple events in JSON array” for your Webhooks configuration. Once your webhook events are batched, your sever should expect an array with just a single event object in it when there’s a single event.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.