API References - Real Time Messaging
Welcome to the Awesome Chat API documentation! This API offers a robust set of endpoints for creating and managing chat platforms. Features include Room Management, Message Handling, Polls, Chat History, Message Replies, Room Role-Based Access Control (RBAC), Admin Moderation, User Management, Attachments, Emojis and Efficient Search Capabilities.
Get started by obtaining your API key and referring to detailed documentation for each endpoint. Ensure proper authentication and authorization for secure integration. Create a dynamic and feature-rich chat platform with the Awesome Chat API!
GET /api/v1/messaging/rooms HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Rooms response
{
"rooms": [
{
"allowed_user_ids": [
"user_1_id",
"user_2_id"
],
"app_id": "789",
"created_by": "1001",
"id": 123,
"owner_id": 789,
"session_id": "channel123",
"status": "active"
},
{
"allowed_user_ids": [
"user_3_id",
"user_4_id"
],
"app_id": "123",
"created_by": "1002",
"id": 456,
"owner_id": 789,
"session_id": "channel456",
"status": "inactive"
}
]
}
Parameters for creating a room
Allowed User IDs
Create Channel
Room status
POST /api/v1/messaging/rooms/create HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 87
{
"allowed_user_ids": [
"user_1_id",
"user_2_id"
],
"channel_id": "room123",
"status": "active"
}
Room response
{
"room": {
"allowed_user_ids": [
"user_1_id",
"user_2_id"
],
"app_id": "789",
"created_by": "1001",
"id": 123,
"owner_id": 456,
"session_id": "channel123",
"status": "active"
}
}
Channel ID
channel123
GET /api/v1/messaging/rooms/{channel_id} HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Room response
{
"room": {
"allowed_user_ids": [
"user_1_id",
"user_2_id"
],
"app_id": "789",
"created_by": "1001",
"id": 123,
"owner_id": 456,
"session_id": "channel123",
"status": "active"
}
}
Channel ID
channel123
Number of messages to retrieve
10
Offset for pagination
0
List of message IDs
[2001,2002]
messages group by day
false
GET /api/v1/messaging/rooms/{channel_id}/messages HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Message response
{
"content": "Hello, world!",
"created_by": "123",
"created_by_name": "John Doe",
"id": 1001,
"inserted_at": "2023-11-20T08:30:00Z"
}
Channel ID
channel123
Parameters for deleting messages
If true, delete all messages in the channel
list of messages ids to delete
[2001,2002]
DELETE /api/v1/messaging/rooms/{channel_id}/messages HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 43
{
"is_empty": true,
"message_ids": [
1000,
1001
]
}
Message replies deleted successfully
{
"message": "Message deleted successfully"
}
Channel ID
channel123
Search term
keyword
GET /api/v1/messaging/rooms/{channel_id}/messages/search HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Message response
{
"content": "Hello, world!",
"created_by": "123",
"created_by_name": "John Doe",
"id": 1001,
"inserted_at": "2023-11-20T08:30:00Z"
}
Channel ID
channel123
Message ID
1001
GET /api/v1/messaging/rooms/{channel_id}/messages/{message_id} HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Message response
{
"content": "Hello, world!",
"created_by": "123",
"created_by_name": "John Doe",
"id": 1001,
"inserted_at": "2023-11-20T08:30:00Z"
}
Channel ID
channel123
Message ID
1001
Parameters for editing a message
New content for the message
PUT /api/v1/messaging/rooms/{channel_id}/messages/{message_id} HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 29
{
"content": "Updated content"
}
Message response
{
"content": "Hello, world!",
"created_by": "123",
"created_by_name": "John Doe",
"id": 1001,
"inserted_at": "2023-11-20T08:30:00Z"
}
Channel ID
channel123
Message ID
1001
messages group by day
false
GET /api/v1/messaging/rooms/{channel_id}/messages/{message_id}/messages_replies HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Message response with replies
{
"content": "Hello, world!",
"created_by": "123",
"created_by_name": "John Doe",
"id": 1001,
"inserted_at": "2023-11-20T08:30:00Z"
}
Channel ID
channel123
Message ID
1001
Parameters for deleting message replies
List of reply message IDs to delete
[2001,2002]
DELETE /api/v1/messaging/rooms/{channel_id}/messages/{message_id}/messages_replies HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 33
{
"reply_message_ids": [
1000,
1002
]
}
Message replies deleted successfully
{
"message": "Message deleted successfully"
}
Channel ID
channel123
Message ID
1001
GET /api/v1/messaging/rooms/{channel_id}/messages/{message_id}/poll/is_voted HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Is voted response
{
"is_voted": true
}
Channel ID
channel123
Message ID
1001
GET /api/v1/messaging/rooms/{channel_id}/messages/{message_id}/poll/votes HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Total votes response
{
"votes": [
{
"answer": 1,
"user_id": "123"
},
{
"answer": 2,
"user_id": "456"
}
]
}
Channel ID
channel123
Message ID
1001
Poll Option ID
1
POST /api/v1/messaging/rooms/{channel_id}/messages/{message_id}/poll/{poll_option_id} HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Poll answer response
{
"poll_answer": {
"answer": 1,
"user_id": "123"
}
}
Channel ID
channel123
User ID
1001
GET /api/v1/messaging/rooms/{channel_id}/users/{user_id} HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
User response
{
"user": {
"id": "789",
"name": "John Doe"
}
}
Channel ID
channel123
User ID
1001
POST /api/v1/messaging/rooms/{channel_id}/users/{user_id} HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Room response
{
"room": {
"allowed_user_ids": [
"user_1_id",
"user_2_id"
],
"app_id": "789",
"created_by": "1001",
"id": 123,
"owner_id": 456,
"session_id": "channel123",
"status": "active"
}
}
Channel ID
channel123
User ID
1001
DELETE /api/v1/messaging/rooms/{channel_id}/users/{user_id} HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Room response
{
"room": {
"allowed_user_ids": [
"user_1_id",
"user_2_id"
],
"app_id": "789",
"created_by": "1001",
"id": 123,
"owner_id": 456,
"session_id": "channel123",
"status": "active"
}
}
Search term
john
GET /api/v1/messaging/users/search HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Users response
{
"users": [
{
"id": "789",
"name": "John Doe"
},
{
"id": "123",
"name": "Johnathan"
}
]
}
Generate a JWT token based on provided parameters.
Parameters for generating a token
API key tied to the Sariska account
Exp claim of JWT token
Nbf claim of JWT token
Scope of the token (messaging, media, sariska, or leave it blank)
POST /api/v1/misc/generate-token HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 228
{
"apiKey": "iufwenufewifweifiuTbddhbdjhjfbjfjwfjwfj",
"exp": "24 hours",
"nbf": "",
"scope": "messaging",
"user": {
"avatar": "https://some-storage-location/nick.jpg",
"email": "[email protected]",
"id": "ytyVgh",
"moderator": false,
"name": "Nick"
}
}
Token generated successfully
{
"token": "your_generated_token_here"
}
Get S3 presigned url and upload media to directly your s3 as you have configured in console
request for presigned url to upload and attach media
File name
some-s3-folder/file-name.jpeg
File extension
jpeg
POST /api/v1/misc/get-presigned HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 62
{
"fileName": "some-s3-folder/file-name.jpeg",
"fileType": "jpeg"
}
Presigned URL generated successfully
{
"presigned_url": "url"
}
Channel ID
channel123
GET /api/v1/rooms/{channel_id}/users HTTP/1.1
Host: api.sariska.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Users response
{
"users": [
{
"id": "789",
"name": "John Doe"
},
{
"id": "123",
"name": "Krish"
}
]
}
For a full list of APIs go to: https://messaging.sariska.io/swaggerui
Last updated