Messages sending
Description
POST /sendmessage
The method provides an opportunitu to queue messages for sending.
URL resource:
https://app.api-messenger.com/sendmessage
Input data
Post-request body structure:
[
{
"chatId": "{string}",
"message": "{string}"
},
...
]
Post-request body passes the following parameters:
Parameter | Required | Value |
---|---|---|
chatId | Yes | The message recipient in WhatsApp API format: 71111111111@c.us , если получатель группа: 79261879777-1513760411@g.us |
message | Yes | Text message |
Output data
Below is shown the output structure.
{
"status": "{enum}",
"message": "{string}"
}
Parameters description:
Parameter | Value |
---|---|
status | Response status. Possible values:
|
message | A message containing either an error description, or, if successful, the messages number added in the format Successfully added 10 |
Errors description
The server returns an HTTP response code and a brief error description in the event of error.
Restrictions
It’s possible to send no more than 100 messages in one request.
Examples
Query example:
curl -i -H 'Content-Type: application/json' -X POST 'https://app.api-messenger.com/sendmessage'
POST-request body:
-d '[
{
"chatId": "71111111111@c.us",
"message": "Simple, useful grammar"
},
{
"chatId": "79261879777-1513760411@g.us",
"message": "Sufficient vocabulary"
},
]'
Response example:
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
...
{
"status": "OK",
"message": "Successfully added 2"
}