The Allo API allows you to create and manage chat conversations between users. It uses Socket.IO to enable real-time messaging and events.
Join an existing conversation.
Request Body:
{
"conversationID": "string"
}
Create a new conversation.
Request Body:
{
"participants": ["string"],
"type": "string",
"topic": "string",
"owner": "string"
}
Send a message in a conversation.
Request Body:
{
"userID": "string",
"conversationID": "string",
"message": "string"
}
Send a secure message in a conversation.
Request Body:
{
"userID": "string",
"conversationID": "string",
"message": "string",
"encrypted": "boolean",
"encryptionAlgorithm": "string",
"signature": "string"
}
Report a message in a conversation.
Request Body:
{
"conversationID": "string",
"messageId": "string",
"reason": "string"
}
Edit a message in a conversation.
Request Body:
{
"conversationID": "string",
"messageId": "string",
"newMessage": "string"
}
Delete a message in a conversation.
Request Body:
{
"conversationID": "string",
"messageId": "string"
}
Forward a message to another conversation.
Request Body:
{
"fromConversationID": "string",
"toConversationID": "string",
"messageId": "string"
}
Mark a message as read in a conversation.
Request Body:
{
"conversationID": "string",
"messageId": "string"
}
Pin a message in a conversation.
Request Body:
{
"conversationID": "string",
"messageId": "string",
"pin": "boolean"
}
React to a message in a conversation.
Request Body:
{
"conversationID": "string",
"messageId": "string",
"emoji": "string"
}
Schedule a message to be sent in a conversation.
Request Body:
{
"userID": "string",
"conversationID": "string",
"message": "string",
"scheduledTime": "string"
}
Unsend a message in a conversation.
Request Body:
{
"conversationID": "string",
"messageId": "string"
}
Send an ephemeral message in a conversation.
Request Body:
{
"userID": "string",
"conversationID": "string",
"message": "string",
"expiresIn": "number"
}
Send a voice message in a conversation.
Request Body:
{
"userID": "string",
"conversationID": "string",
"message": "string",
"voiceUrl": "string"
}
Send a sticker in a conversation.
Request Body:
{
"userID": "string",
"conversationID": "string",
"stickerUrl": "string"
}
Create a poll in a conversation.
Request Body:
{
"userID": "string",
"conversationID": "string",
"question": "string",
"options": ["string"]
}
Vote on a poll in a conversation.
Request Body:
{
"conversationID": "string",
"messageId": "string",
"optionIndex": "number"
}
To run the API, use the following commands:
npm install
npm start
The API will be available at http://localhost:5000
.
The project is organized into the following directories:
src/routes
: Contains the route definitions for the API.src/controllers
: Contains the controller logic for handling API requests.src/services
: Contains the service logic for interacting with the database.src/models
: Contains the Mongoose models for the database.src/middleware
: Contains the middleware for security and other purposes.