Mesibo Backend APIs - Messaging
While your users can send messages to each other or groups using Mesibo real-time APIs, your backend can also send messages to one of your users or groups using backend API.
To send a message, you need to send a message JSON request to the backend API, for example:
{
"op": "message",
"token": "ptlk9hdel1gqxf3p0s15f5f5gtusldej18tl794suzit",
"message": {
"from": "me",
"to": "you,she,he",
"gid": 111,
"type": 0,
"expiry": 3600,
"flags": null,
"forced": true,
"message": "This is my message"
}
}
Parameter | Description | Default |
---|---|---|
op | MUST have the value - "message" (see example above) | Mandatory |
token | Application Token obtained from the mesibo console | Mandatory |
message.from | From address [MUST be a valid user] | |
message.to | To addresses, comma separated | |
message.gid | Group ID | 0 |
message.type | Message Type | 0 |
message.expiry | Expiry in seconds | 1 year |
message.when | Schedule after when seconds | 0 (now) |
message.message | Message | |
message.url | File URL | |
message.title | Title, when sending a file URL |
If the request is successful, the response will be like,
{
"op":"message",
"mid": 1387628,
"result":true
}