Created
July 22, 2015 01:24
-
-
Save vtrehan/4ecf0ef8b97a344a4809 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##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. | | |
| `message.read` | When a client marks a Message as read. | | |
| `message.deleted` | When a client deletes a Message (Global deletion mode only). | | |
| `conversation.created` | When a new Conversation is created. | | |
| `conversation.participants_updated` | When a Conversation is updated participant changes. | | |
| `conversation.metadata_updated` | When a Conversation is updated for metadata changes. | | |
| `conversation.deleted` | When a Conversation is deleted (Global deletion mode only). | | |
### `message.sent` | |
Written when a new Message is sent. | |
```json | |
{ | |
"event_type": "message.sent" | |
"event_id": "640de862-3c96-11e4-baad-164230d1df67" | |
"message": { | |
"id": "layer:///messages/940de862-3c96-11e4-baad-164230d1df67", | |
"url": "https://api.layer.com/apps/082d4684-0992-11e5-a6c0-1697f925ec7b/messages/940de862-3c96-11e4-baad-164230d1df67", | |
"conversation": { | |
"id": "layer:///conversations/e67b5da2-95ca-40c4-bfc5-a2a8baaeb50f", | |
"url": "https://api.layer.com/apps/082d4684-0992-11e5-a6c0-1697f925ec7b/conversations/e67b5da2-95ca-40c4-bfc5-a2a8baaeb50f" | |
}, | |
"parts": [ | |
{ | |
"id": "layer:///messages/940de862-3c96-11e4-baad-164230d1df67/parts/0", | |
"mime_type": "text/plain", | |
"body": "This is the message.", | |
"size": 20 | |
}, | |
{ | |
"mime_type": "image/png", | |
"content": { | |
"id": "layer:///messages/940de862-3c96-11e4-baad-164230d1df67/parts/1", | |
"download_url": "http://google-testbucket.storage.googleapis.com/some/download/path", | |
"expiration": "2014-09-09T04:44:47+00:00", | |
"refresh_url": "https://api.layer.com/content/7a0aefb8-3c97-11e4-baad-164230d1df67", | |
"size": 172114124 | |
}, | |
"size": 172114124 | |
} | |
], | |
"sent_at": "2014-09-09T04:44:47+00:00", | |
"received_at": "2014-09-16T19:54:39+00:00", | |
"sender": { | |
"id": "12345", | |
"name": "t-bone" | |
}, | |
"recipient_status": { | |
"12345": "read", | |
"999": "sent", | |
"111": "sent" | |
} | |
} | |
} | |
``` | |
### `message.delivered` | |
Written when a Message recipient acknowledges delivery of a Message. | |
```json | |
{ | |
"event_type": "message.delivered" | |
"event_id": "640de862-3c96-11e4-baad-164230d1df67" | |
"message": { | |
"id": "layer:///messages/940de862-3c96-11e4-baad-164230d1df67", | |
"url": "https://api.layer.com/apps/082d4684-0992-11e5-a6c0-1697f925ec7b/messages/940de862-3c96-11e4-baad-164230d1df67", | |
"conversation": { | |
"id": "layer:///conversations/e67b5da2-95ca-40c4-bfc5-a2a8baaeb50f", | |
"url": "https://api.layer.com/apps/082d4684-0992-11e5-a6c0-1697f925ec7b/conversations/e67b5da2-95ca-40c4-bfc5-a2a8baaeb50f" | |
}, | |
"parts": [ | |
{ | |
"id": "layer:///messages/940de862-3c96-11e4-baad-164230d1df67/parts/0", | |
"mime_type": "text/plain", | |
"body": "This is the message.", | |
"size": 20 | |
}, | |
{ | |
"mime_type": "image/png", | |
"content": { | |
"id": "layer:///messages/940de862-3c96-11e4-baad-164230d1df67/parts/1", | |
"download_url": "http://google-testbucket.storage.googleapis.com/some/download/path", | |
"expiration": "2014-09-09T04:44:47+00:00", | |
"refresh_url": "https://api.layer.com/content/7a0aefb8-3c97-11e4-baad-164230d1df67", | |
"size": 172114124 | |
}, | |
"size": 172114124 | |
} | |
], | |
"sent_at": "2014-09-09T04:44:47+00:00", | |
"received_at": "2014-09-16T19:54:39+00:00", | |
"sender": { | |
"id": "12345", | |
"name": "t-bone" | |
}, | |
"recipient_status": { | |
"777": "sent", | |
"12345": "read", | |
"111": "delivered" | |
} | |
} | |
} | |
``` | |
### `message.read` | |
Written when a Message recipient marks a Message as read. | |
```json | |
{ | |
"event_type": "message.read" | |
"event_id": "640de862-3c96-11e4-baad-164230d1df67" | |
"message": { | |
"id": "layer:///messages/940de862-3c96-11e4-baad-164230d1df67", | |
"url": "https://api.layer.com/apps/082d4684-0992-11e5-a6c0-1697f925ec7b/messages/940de862-3c96-11e4-baad-164230d1df67", | |
"conversation": { | |
"id": "layer:///conversations/e67b5da2-95ca-40c4-bfc5-a2a8baaeb50f", | |
"url": "https://api.layer.com/apps/082d4684-0992-11e5-a6c0-1697f925ec7b/conversations/e67b5da2-95ca-40c4-bfc5-a2a8baaeb50f" | |
}, | |
"parts": [ | |
{ | |
"id": "layer:///messages/940de862-3c96-11e4-baad-164230d1df67/parts/0", | |
"mime_type": "text/plain", | |
"body": "This is the message.", | |
"size": 20 | |
}, | |
{ | |
"id": "layer:///messages/940de862-3c96-11e4-baad-164230d1df67/parts/1", | |
"mime_type": "image/png", | |
"content": { | |
"id": "layer:///content/3d0736d9-1a50-4e9a-a9b3-2400caa9e161", | |
"download_url": "http://google-testbucket.storage.googleapis.com/some/download/path", | |
"expiration": "2014-09-09T04:44:47+00:00", | |
"size": 172114124 | |
}, | |
} | |
], | |
"sent_at": "2014-09-09T04:44:47+00:00", | |
"received_at": "2014-09-16T19:54:39+00:00", | |
"sender": { | |
"id": "12345", | |
"name": "t-bone" | |
}, | |
"recipient_status": { | |
"12345": "read", | |
"999": "read", | |
"111": "delivered" | |
} | |
} | |
} | |
``` | |
### `message.deleted` | |
Written when a Message is globally deleted. | |
```json | |
{ | |
"event_type": "message.deleted" | |
"event_id": "640de862-3c96-11e4-baad-164230d1df67" | |
"message": { | |
"id": "layer:///messages/940de862-3c96-11e4-baad-164230d1df67", | |
"url": "https://api.layer.com/apps/082d4684-0992-11e5-a6c0-1697f925ec7b/messages/940de862-3c96-11e4-baad-164230d1df67", | |
"conversation": { | |
"id": "layer:///conversations/e67b5da2-95ca-40c4-bfc5-a2a8baaeb50f", | |
"url": "https://api.layer.com/apps/082d4684-0992-11e5-a6c0-1697f925ec7b/conversations/e67b5da2-95ca-40c4-bfc5-a2a8baaeb50f" | |
}, | |
"parts": [ | |
{ | |
"id": "layer:///messages/940de862-3c96-11e4-baad-164230d1df67/parts/0", | |
"mime_type": "text/plain", | |
"body": "This is the message." | |
}, | |
{ | |
"id": "layer:///messages/940de862-3c96-11e4-baad-164230d1df67/parts/1", | |
"mime_type": "image/png", | |
"content": { | |
"id": "layer:///content/3d0736d9-1a50-4e9a-a9b3-2400caa9e161", | |
"download_url": "http://google-testbucket.storage.googleapis.com/some/download/path", | |
"expiration": "2014-09-09T04:44:47+00:00", | |
"size": 172114124 | |
} | |
}, | |
{ | |
"mime_type": "image/jpeg", | |
"body": "iVBORw0KGgoAAAANSUhEUgAAACA=", | |
"encoding": "base64", | |
"id": "layer:///messages/940de862-3c96-11e4-baad-164230d1df67/parts/2", | |
} | |
], | |
"sent_at": "2014-09-09T04:44:47+00:00", | |
"received_at": "2014-09-16T19:54:39+00:00", | |
"sender": { | |
"id": "12345", | |
}, | |
} | |
} | |
``` | |
### `conversation.created` | |
Written when a new Conversation is created. | |
```json | |
{ | |
"event_type": "conversation.created" | |
"event_id": "640de862-3c96-11e4-baad-164230d1df67" | |
"conversation": { | |
"id": "layer:///conversations/f3cc7b32-3c92-11e4-baad-164230d1df67", | |
"url": "https://api.layer.com/apps/082d4684-0992-11e5-a6c0-1697f925ec7b/conversations/e67b5da2-95ca-40c4-bfc5-a2a8baaeb50f", | |
"created_at": "2014-09-15T04:44:47+00:00", | |
"messages_url": "https://api.layer.com/conversations/c12fd916-1390-464b-850f-1380a051f7c8/messages", | |
"distinct": false, | |
"participants": [ | |
"1234", | |
"5678" | |
], | |
"metadata": { | |
"favorite": "true", | |
"background_color": "#3c3c3c" | |
} | |
} | |
} | |
``` | |
### `conversation.participants_updated` | |
Written when a Conversation is updated through mutation of the participants list. | |
```json | |
{ | |
"event_type": "conversation.participants_updated" | |
"event_id": "640de862-3c96-11e4-baad-164230d1df67" | |
"conversation": { | |
"id": "layer:///conversations/f3cc7b32-3c92-11e4-baad-164230d1df67", | |
"url": "https://api.layer.com/apps/082d4684-0992-11e5-a6c0-1697f925ec7b/conversations/e67b5da2-95ca-40c4-bfc5-a2a8baaeb50f", | |
"created_at": "2014-09-15T04:44:47+00:00", | |
"messages_url": "https://api.layer.com/conversations/c12fd916-1390-464b-850f-1380a051f7c8/messages", | |
"distinct": false, | |
"participants": [ | |
"1234", | |
"5678" | |
], | |
"metadata": { | |
"favorite": "true", | |
"background_color": "#3c3c3c" | |
} | |
} | |
} | |
``` | |
### `conversation.metadata_updated` | |
Written when a Conversation is updated through mutation of metadata. | |
```json | |
{ | |
"event_type": "conversation.metadata_updated" | |
"event_id": "640de862-3c96-11e4-baad-164230d1df67" | |
"conversation": { | |
"id": "layer:///conversations/f3cc7b32-3c92-11e4-baad-164230d1df67", | |
"url": "https://api.layer.com/apps/082d4684-0992-11e5-a6c0-1697f925ec7b/conversations/e67b5da2-95ca-40c4-bfc5-a2a8baaeb50f", | |
"created_at": "2014-09-15T04:44:47+00:00", | |
"messages_url": "https://api.layer.com/conversations/c12fd916-1390-464b-850f-1380a051f7c8/messages", | |
"distinct": false, | |
"participants": [ | |
"1234", | |
"5678" | |
], | |
"metadata": { | |
"favorite": "true", | |
"background_color": "#3c3c3c" | |
} | |
} | |
} | |
``` | |
### `conversation.deleted` | |
Written when a Conversation is globally deleted. | |
```json | |
{ | |
"event_type": "conversation.deleted" | |
"event_id": "640de862-3c96-11e4-baad-164230d1df67" | |
"conversation": { | |
"id": "layer:///conversations/f3cc7b32-3c92-11e4-baad-164230d1df67", | |
"url": "https://api.layer.com/apps/082d4684-0992-11e5-a6c0-1697f925ec7b/conversations/e67b5da2-95ca-40c4-bfc5-a2a8baaeb50f", | |
"created_at": "2014-09-15T04:44:47+00:00", | |
"messages_url": "https://api.layer.com/conversations/c12fd916-1390-464b-850f-1380a051f7c8/messages", | |
"distinct": false, | |
"participants": [ | |
"1234", | |
"5678" | |
], | |
"metadata": { | |
"favorite": "true", | |
"background_color": "#3c3c3c" | |
} | |
} | |
} | |
``` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment