Skip to content

Instantly share code, notes, and snippets.

@boo1ean
Last active March 7, 2016 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boo1ean/1a9f64d06c8206b7ad56 to your computer and use it in GitHub Desktop.
Save boo1ean/1a9f64d06c8206b7ad56 to your computer and use it in GitHub Desktop.

Join channel

Join to channel using specified identifier. After joining user will remain active in channel until manual leave request

Request

POST /channels/{channel_name}/join
{
	"identifier": "user@example.com"
}

Response

{
	"identity_token": "123yatoken456"
}

Get list of channel members

Request

GET /channels/{channel_name}/members

Request Headers

X-IDENTITY-TOKEN: IDENTITY_TOKEN

Response

[
	{
		"identifier": "member1@example.com"
	},
	{
		"identifier": "member2@example.com"
	}
]

Post message to channel

Messages are JSON objects with strict structure

Request

POST /channels/{channel_name}/messages

You can use any message structure (any property names and any number of properties except id and created_at). Message body example:

{
	"message": "This is message"
}

Request Headers

X-IDENTITY-TOKEN: IDENTITY_TOKEN

Response

Get channel messages

Request

GET /channels/{channel_name}/messages?last_message_id=10032
Params
  • last_message_id - will return messages after specified id

Request Headers

X-IDENTITY-TOKEN: IDENTITY_TOKEN

Response

{
	"id": 123,
	"created_at": 2318893224,
	"message": "some message content"
}
  • created_at - unix timestamp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment