Skip to content

Instantly share code, notes, and snippets.

Layer Webhooks Pre-release

Webhooks allow you to develop integrations which subscribe to events within your Layer application. When a subscribed event is triggered, Layer will send an HTTP POST payload to the endpoint designated in the webhook configuration. Webhooks provide a simple, flexible mechanism that you can use to signal an external system to take action in response to messaging activity within your app. You can use Webhooks to implement things like:

  • Add context to conversations: respond to messages mentioning keywords.
  • Notify another user when they are @mentioned
  • Send a welcome message when a user registers (build a great onboarding experience)
  • Integrate a third-party service (Uber API, Weather Underground, etc) into conversations based on context

Event Types

# Layer Webhooks Pre-release
Webhooks allow you to develop integrations which subscribe to events within your Layer application. When a subscribed event is triggered, Layer will send an HTTP POST payload to the endpoint designated in the webhook configuration. Webhooks provide a simple, flexible mechanism that you can use to signal an external system to take action in response to messaging activity within your app. You can use Webhooks to implement things like:
* Add context to conversations: respond to messages mentioning keywords.
* Notify another user when they are @mentioned
* Send a welcome message when a user registers (build a great onboarding experience)
* Integrate a third-party service (Uber API, Weather Underground, etc) into conversations based on context
## Event Types

Layer Data Export

Our users are exposed to our conversation and message data model, we need to enable them to be able to look at their messaging data and perform their own analysis on it to improve their product.

As part of the data export service, we will write certain events to a file, compress and encrypt it. These files will be uploaded to Google Cloud Services bucket and a link will be sent to the customers using a webhook notification at the end of the day. The payloads will be encrypted using RSA 2048 asymmetric cryptography. The clients will have access to the public key (via the developer portal) to decrypt the payloads after receiving the link. The files will be compressed using tar gzip.

##Events

We can collect daily dumps of Events from Layer that can be stored and sliced/diced based on your needs.

##Events
We can collect daily dumps of Events from Layer that can be stored and sliced/diced based on your needs.
Each event type corresponds to a specific action that can occur within your Layer application. The current set of available event types are:
| Event | Description |
|--------|--------------|
| `message.sent` | When a Message is sent. |
| `message.delivered` | When a client acknowledges delivery of a Message. |