Mesibo Backend APIs (Server-side APIs)
mesibo backend API is a set of REST-like HTTPS APIs that allows you to create and manage users that can use mesibo real-time APIs. In addition to that, it also lets you administer your account, manage apps, manage groups, etc. You can access mesibo backend APIs using any language of your choice.
For most apps, you only need to use the backend APIs to create users and nothing else. Once the user is created, your apps can use real-time APIs for all other operations like sending messages, creating and managing groups, etc.
Security Note
For maintaining privacy and security, the backend API should only be accessed from your backend servers. Your apps/clients MUST NOT access backend APIs directly as it will expose your app token. For the privacy of your app data, mesibo will disable the app if the breach is detected or the backend APIs accessed from more than five IP addresses (TOKENBREACH).
Backend API Request and Response Structure
mesibo backend APIs are JSON-based APIs, all requests and responses are in JSON (application/json).
Mesibo Backend API URL
If you are not using mesibo on-premise, the following is the backend API URL:
https://api.mesibo.com/backend/
For on-premise, refer to Using Backend APIs with On-Premise to learn how to download and host backend APIs on your own server.
Request Structure
Content-Type: application/json
{
"op":"useradd",
"token": "ptlk9hdel1gqxf3p0s15f5f5gtusldej18tl794suzit",
"user": {
"address":"xyz@example.com",
}
}
Every API request will have minimum two parameters:
- operation (op), identifies the operation requested.
- Application token (token), unique app token for your application which your MUST not share with anyone including your users. You can get and change the app token from the mesibo Consoleopen_in_new.
- [Optional] Request Identifier (id), any random integer value to identify request. It will be returned back in the response.
There can be more parameters depending on the operation.
Response Structure
The response is a JSON object with at least the following fields, and other fields depending on the operation.
- op, requested operation
- result,
true
if successful,false
otherwise - error, error code if the request failed
Parameter | Description | |
---|---|---|
op | requested operation | |
result | true if successful, false otherwise | |
error | error code if the request failed | |
code | RFC 9110 compliant error code if the request failed | |
cause | text describing cause of error | |
action | text describing suggested fix for the error | |
properties | array of the request properties that caused the error. It may not include all the properties. |
An example of a successful JSON response is as follows:
Content-Type: application/json
{
"user": {
"uid":123,
"address":"xyz@example.com",
"token":"79a818d76f45fb5a3ac395a0a98251c3db2eetb7b0d4aa0"
},
"op":"useradd",
"result":true
}
An example of a failed JSON response is as follows:
Content-Type: application/json
{
"op":"someop",
"result":false,
"error": "BADVALUE",
"code": 400,
"cause": "some error message",
"action": "suggested action to fix the issue",
"properties": ["name"]
}
Getting Familiar with Backend APIs
You may use Mesibo Backend API Playground to quickly familiarize yourself with syntax and parameters. The best way to use the playground is to use it when reading the reference section below.
You can also use curl
to send API requests
curl -X POST https://api.mesibo.com/backend
-H 'Content-Type: application/json'
-d '{"op":"useradd","token":"abc"}'
PHP Helper SDK
A PHP helper class for mesibo REST API is available on GitHubopen_in_new. Even if you are not using PHP, it should serve as a good reference for your implementation and parameters/payload.
Mesibo backend APIs Reference
Mesibo backend API is broadly categorized into three categories:
You can visit each section to learn more about it.