Skip to content

Send or Update a Message

POST api/message

This is used to send or update messages.

Example Request

Terminal window
curl -X 'POST' \
'http://localhost:8080/api/message' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{
"group_chat_id": <message_id>,
"message_content": <message_content>,
}'

Parameters

message_id

Type: Form Data
Data Type: Integer
Required: No
Description: The ID of the message

group_chat_id

Type: Form Data
Data Type: Integer
Required: Yes
Description: The ID of the group chat

message_reply_id

Type: Form Data
Data Type: Integer
Required: No
Description: The ID of the message

message_content

Type: Form Data
Data Type: String
Required: Yes
Description: The content of the message

attachments

Type: Form Data
Data Type: Array of Image File
Required: No
Description: The files for the image attachments

Responses

200 - OK

The request was successful

Content Type: application/json
Content: Full Message

{
"id": "string",
"group_chat_id": "string",
"message_content": "string",
"user": {
"id": 0,
"user_first_name": "string",
"user_middle_name": "string",
"user_last_name": "string",
"user_username": "string",
"user_avatar_url": "string",
"user_visible": "string"
},
"replied_to": {
"id": "string",
"group_chat_id": "string",
"message_content": "string",
"user": {
"id": 0,
"user_first_name": "string",
"user_middle_name": "string",
"user_last_name": "string",
"user_username": "string",
"user_avatar_url": "string",
"user_visible": "string"
},
"created_at": "2025-01-21T05:33:55.062Z",
"updated_at": "2025-01-21T05:33:55.062Z"
},
"seens": [
{
"user": {
"id": 0,
"user_first_name": "string",
"user_middle_name": "string",
"user_last_name": "string",
"user_avatar_url": "string"
}
}
],
"reactions": [
{
"id": "string",
"message_id": "string",
"message_reaction": "string",
"message_reaction_count": "string",
"created_at": "2025-01-21T05:33:55.062Z",
"updated_at": "2025-01-21T05:33:55.062Z"
}
],
"attachments": [
{
"id": 0,
"message_attachment_url": "string",
"message_attachment_added_to_album": true,
"user": {
"id": 0,
"user_first_name": "string",
"user_middle_name": "string",
"user_last_name": "string",
"user_username": "string",
"user_avatar_url": "string",
"user_visible": "string"
},
"created_at": "2025-01-21T05:33:55.062Z",
"updated_at": "2025-01-21T05:33:55.062Z"
}
],
"created_at": "2025-01-21T05:33:55.062Z",
"updated_at": "2025-01-21T05:33:55.062Z"
}

400 - Bad Request

Validation Error

Content Type: application/json
Content:

{
"param_name": [
"string"
],
"param_name_2": [
"string"
]
}

401 - Unauthorized

The request requires valid bearer token, but none were provided, or the bearer token is invalid.

404 - Not Found

The server could not find the requested resource.

Content Type: text/plain
Content:

Group chat not found!

429 - Too Many Requests

The user has exceeded the rate limit of 200 requests per minute.

500 - Internal Server Error

There is an issue with the backend. Sentry will provide a more detailed report on the problem.