API Reference
Chats
Send and retrieve messages for app chat channels.
Send Message
| Field | Description | |
|---|---|---|
| session_id | Required | Active session ID from a successful Init call. |
| channel_name | Required | Name of the channel to send the message to (e.g. general). |
| message | Required | The message content to broadcast. |
Example Request
{
"session_id": "dc1ce...a3a75",
"channel_name": "general",
"message": "hello"
}
Get Messages
| Field | Description | |
|---|---|---|
| session_id | Required | Active session ID from a successful Init call. |
| channel_name | Required | Name of the channel to fetch messages from. |
| limit | Optional | Maximum number of messages to return. Defaults to 50. |
| cursor | Optional | Pagination cursor for older messages. Pass null for the first request. |
Example Request
{
"session_id": "dc1ce...a3a75",
"channel_name": "general",
"limit": 50,
"cursor": null
}
Responses
Message sent or messages retrieved successfully.
{
"success": true,
"message": "Messages retrieved successfully",
"data": {
"channel_name": "general",
"messages": [],
"pagination": {
"limit": 50,
"next_cursor": null,
"has_more": false
}
}
}
MISSING_FIELDS — Required fields were not sent.
{
"success": false,
"code": "MISSING_FIELDS",
"message": "Required fields are missing"
}
Session check failed. Codes: INVALID_SESSION, SESSION_EXPIRED.
{
"success": false,
"code": "SESSION_EXPIRED",
"message": "Session has expired"
}
User muted or not linked. Codes: USER_MUTED, USERNAME_NOT_LINKED.
{
"success": false,
"code": "USER_MUTED",
"message": "You are muted in this channel"
}
CHANNEL_NOT_FOUND — The specified channel does not exist.
{
"success": false,
"code": "CHANNEL_NOT_FOUND",
"message": "Chat channel not found"
}
INTERNAL — Unexpected server-side error.
{
"success": false,
"code": "INTERNAL",
"message": "An internal server error occurred"
}