Send message / image
Please use this (https://surredo.space/mobile_api/send_message) API for accessing the endpoint of sending a message
Post parameters
Field | Value | Remarks |
---|---|---|
session_id | Access token ID | E.g. de25cc16eb00960f076... |
user_id | User ID of the interlocutor | E.g. 4567 |
type | Message type Text or Image | E.g. One of these options (text/media) |
image | Message image file | E.g. some-picture.jpeg |
message | Message text (Max length 3000) | E.g. `Hi! How are you?` |
Success response
{
"code": 200,
"message": "Message sent",
"data": {
"id": 49,
"sent_by": 7,
"sent_to": 78,
"owner": true,
"message": "Image",
"media_file": "http://colibri.loc/upload/images/2020/11/lbEG1WesAJdnqVWuUVSd_21_00ae49e181b4a21f86d2338eed424e7b_image_original.jpg",
"media_type": "image",
"seen": "0",
"deleted_fs1": "N",
"deleted_fs2": "N",
"time": "21 Nov, 2020 03:11",
"side": "right",
"media_name": "COLIBRI-IMG-1605960603"
}
}
Error responses
{
"code": 401,
"data": [],
"message": "Unauthorized Access"
}
{
"code": 400,
"message": "Interlocutor ID is missing or invalid",
"data": []
}
{
"code": 400,
"message": "You do not have permission direct messages to this chat",
"data": []
}
{
"code": 400,
"message": "Your account has been blocked by this account",
"data": []
}
{
"code": 500,
"message": "An error occurred while processing your request. Please try again later.",
"data": []
}
{
"code": 400,
"message": "The media type of the message is invalid or missing",
"data": []
}
Get chats
Please use this (https://surredo.space/mobile_api/get_chats) API for accessing the endpoint of the chat list
Get parameters
Field | Value | Remarks |
---|---|---|
session_id | Access token ID | E.g. de25cc16eb00960f076... |
Success response
{
"code": 200,
"message": "Chats successfully",
"data": [
{
"user_id": 78,
"username": "mansurTLs",
"name": "First name Last name",
"avatar": "http://colibri.loc/upload/default/avatar.png",
"verified": "0",
"chat_id": 9,
"time": "17 minutes ago",
"last_message": "y",
"new_messages": "",
"chat_url": "http://colibri.loc/conversation/@mansurTLs"
},
{"user_id": 34, "username": "jack_nelson", "name": "Jack Nelson", "avatar": "http://colibri.loc/upload/default/avatar.png",…}
]
}
Error responses
{
"code": 401,
"data": [],
"message": "Unauthorized Access"
}
Get Messages
Please use this (https://surredo.space/mobile_api/get_messages) API for accessing the endpoint of the message list
Get parameters
Field | Value | Remarks |
---|---|---|
session_id | Access token ID | E.g. de25cc16eb00960f076... |
user_id | User ID of the interlocutor | E.g. 4567 |
offset_up | First message offset ID | This is only needed when loading old messages from the current chat. |
offset_down | Last message offset ID | This is only needed when loading new messages from the current chat. |
page_size | Total message limit for each request | Recommended: 20 |
Success response
{
"code": 200,
"data": [
{
"id": 86,
"sent_by": 7,
"sent_to": 78,
"owner": true,
"message": "1",
"media_file": "",
"media_type": "none",
"seen": "0",
"deleted_fs1": "N",
"deleted_fs2": "N",
"time": "22 Nov, 2020 10:11",
"side": "right"
},
{...}
]
}
Error responses
{
"code": 401,
"data": [],
"message": "Unauthorized Access"
}
{
"code": 400,
"message": "Interlocutor ID is missing or invalid",
"data": []
}
{
"code": 204,
"message": "No data found",
"data": []
}
Search Messages
Please use this (https://surredo.space/mobile_api/search_messages) API for accessing the message search endpoint
Get parameters
Field | Value | Remarks |
---|---|---|
session_id | Access token ID | E.g. de25cc16eb00960f076... |
user_id | User ID of the interlocutor | E.g. 4567 |
query | Search keyword | E.g. `Hello` |
page_size | Search result rows limit | Default is (50) rows |
offset_up | First message offset ID | This is only needed when loading previous messages. |
offset_down | Last message offset ID | This is only needed when loading next messages. |
Success response
{
"code": 200,
"total": 1,
"data":[
{
"id": 8,
"sent_by": 10,
"sent_to": 5,
"owner": true,
"message": "Hello!",
"media_file": "",
"media_type": "none",
"seen": "0",
"deleted_fs1": "N",
"deleted_fs2": "N",
"time": "23 Mar, 2021 11:03",
"side": "right",
"media_raw": ""
}
]
}
Error responses
{
"code": 401,
"data": [],
"message": "Unauthorized Access"
}
{
"code": 400,
"message": "Interlocutor ID is missing or invalid",
"data": []
}
{
"code": 204,
"data": [],
"message": "No data found"
}
Delete Message
Please use this (https://surredo.space/mobile_api/delete_message) API for accessing the endpoint of deleting a chat message
Post parameters
Field | Value | Remarks |
---|---|---|
session_id | Access token ID | E.g. de25cc16eb00960f076... |
message_id | Deleted message int ID | E.g. `34` |
Success response
{
"code": 200,
"message": "Message deleted successfully",
"data": []
}
Error responses
{
"code": 401,
"data": [],
"message": "Unauthorized Access"
}
{
"code": 400,
"message": "Message ID is missing or invalid",
"data": []
}
{
"code": 400,
"message": "A message with this ID was not found. Please check your details!",
"data": []
}
Clear Chat/Delete
Please use this (https://surredo.space/mobile_api/clear_chat) API for accessing the endpoint of clearing & deleting chat history
Post parameters
Field | Value | Remarks |
---|---|---|
session_id | Access token ID | E.g. de25cc16eb00960f076... |
user_id | User ID of the interlocutor | E.g. 4567 |
delete_chat | Delete chat after clearing | E.g. One of these options (1/0) |
Success response
{
"code": 200,
"message": "Chat deleted successfully",
"data": []
}
Error responses
{
"code": 401,
"data": [],
"message": "Unauthorized Access"
}
{
"code": 400,
"message": "Interlocutor ID is missing or invalid",
"data": []
}