Webhook Events
Webhook Events is a great way you can extend and build custom functionalities on your own by receiving triggers from Amity Social Cloud. When enabled, events that happen within your Chat and Social SDK are forwarded to your system in real-time. By receiving these events you can build and extend your own functions such as
Storing those events to build your own analytic dashboard
Build custom message moderation or automatic banning system
Build custom search and personalization functionalities based on user activities forwarded to your analytic system.
A webhook can also be termed as a type of API that is driven by events rather than requests. Instead of one application making a request to another to receive a response, a webhook is a service that allows one program to send data to another as soon as a particular event takes place. Webhooks are sometimes referred to as “reverse APIs,” because communication is initiated by the application sending the data rather than the one receiving it.
To receive these events you will need to set up a Webhook system as detailed below.
Setup
When an event is triggered, an HTTP POST payload is sent to the Webhook's configured URL. Webhooks can serve various purposes such as creating push notifications, backup logging or even building external applications based on Webhook events.
Admin users can create new Webhooks in admin panel by using URL
Admin users can delete selected Webhooks in admin panel as well
We recommend having no more than 10 Webhooks per network
All Webhooks will be triggered near-real-time as the events occur. Please seeEvents for list of events available.
To preserve system performance, all webhook HTTP requests will timeout in 1.5 seconds - please make sure your webhook receiver provide response back within the interval to prevent losing any requests.
Upon receiving the webhook, the system should return with response status code of
200
with an empty JSON response.
Webhook feature is currently in Private Beta. Please submit your request to Amity Help Center to enable this feature. It will take approximately 5 business days to process your request.
Delivery Headers
The HTTP POST payloads that are delivered to your webhook's configured URL endpoint will contain the following headers:
Please make sure you verify x-amity-signature
header by calculating HMAC Base64 signature of the payload with the secret key of your corresponding webhook endpoint before processing the event to prevent request forgery.
To maintain legacy support, you may receive 2 requests per event with another request containing x-eko-signature
- you may ignore this request.
Example Delivery
Events
Once webhook is activated, you will start receiving events on a near-real-time basis. Please check our API Reference for full list of events and their payload.
Deprecation Notices
From 20 June 2022, we have deprecated the following legacy webhook events:
message.created
channel.created
channel.joined
channel.membersAdded
v3.video-streaming.didRecord
v3.video-streaming.didStart
v3.video-streaming.didStop
As these webhook events were only accessible internally, this deprecation should have no impact on our current customers. For a list of events that we currently support, please refer to our API Reference.
Last updated