Skip to main content

Module webhooks

Module webhooks 

Source

Structs§

ChatMessage
data of a chat.message event: a message sent in a chat. group is set when a group owns the chat.
Delivery
One event as POSTed to a webhook URL, with a Fauna-Signature header.
GroupChange
data of group.joined and group.left: a person or a nested group came directly into group or went directly out of it. Changes further down (someone leaving a nested group) are told only to that group’s own webhooks.
Reaction
A reaction carried by a chat.message event.
Registration
What create resolves to. The secret is only ever returned here.
Webhook
An outbound webhook. Its events are signed and POSTed to url.

Enums§

EventType
Event types a webhook can listen for: chat.message for groups and chats, group.joined and group.left for groups, payment events for API keys. calendar.event.started goes to a calendar event’s own webhook.
GroupChangeMember
Who came into a group or went out of it: a person, or a group nested directly inside it.
GroupChangeReason
Why: Joined for group.joined; for group.left, the person Left or was Removed by an admin, or the nested group was Unnested or Deleted.
WebhookOwner
Who a webhook belongs to: a group, one chat, or the API key making the call.

Functions§

create
Register a webhook for a group or a chat you can read, or, signed in with an API key, for that key. In production url must be https on a public address. Pass secret to choose the signing secret; otherwise one is made.
list
An owner’s webhooks. Secrets are never listed.
remove
verify
True when signature (the Fauna-Signature header, t=<seconds>,v1=<hex>) is the HMAC SHA-256 of t.body under secret, signed within tolerance seconds of now (300 when None). Pass the raw request body, before any JSON parsing.