POSThttps://{ourserver.com}/api/resellers/addMessages
Batch forward received SMS to Onlinesim server
This request forwards multiple incoming SMS messages to Onlinesim server in a single batch.
We recommend using this method instead of addMessage and sending SMS
in batches, for example once every 5 seconds.
Parameters
header2
| Name | Type | Description |
|---|---|---|
Authorization* | string | see more here |
Content-Type* | string |
Enum: application/json; charset=utf-8 |
Request Body
Your server should send this request when new messages are received and you need to forward multiple SMS at once.
schemaobject
messagesobject[]Required
Examples
{
"messages": [
{
"number": "33712345678",
"from": "Telegram",
"message": "Code: 12345"
},
{
"number": "33712345679",
"from": "WhatsApp",
"message": "Code: 56789"
}
]
}Responses
200Onlinesim server response
Onlinesim server response
schemaobject
resultsobject[]Required
Examples
Onlinesim server response example for `addMessages` request
{
"response": "1",
"total": 2,
"success": 1,
"failed": 1,
"results": [
{
"index": 0,
"number": "33712345678",
"from": "Telegram",
"response": "1"
},
{
"index": 1,
"number": "33712345679",
"from": "WhatsApp",
"response": "0",
"error": "NO_OPERATION"
}
]
}[
{
"response": "ERROR_WRONG_KEY"
}
]400Missing or incorred parameters (request must contain parameters in it's body with proper names as described in documentation)
Missing or incorred parameters (request must contain parameters in it's body with proper names as described in documentation)
schemaobject
401Unauthorized. The request is missing or uses an invalid API key. Some endpoints may return a 200 status with an ERROR_WRONG_KEY message instead of 401 — check the response body
Unauthorized. The request is missing or uses an invalid API key. Some endpoints may return a 200 status with an ERROR_WRONG_KEY message instead of 401 — check the response body
403Forbidden. The request was understood but refused due to insufficient permissions
Forbidden. The request was understood but refused due to insufficient permissions