How it works

  1. We connect to the system the phone number from which messages will be sent.
  2. You choose a pricing plan and pay for it in a way convenient for you.
  3. Using our API, you send out your messages.
Code examples:
$data['json_data'] = json_encode([
  "method"  =>  "whatsapp_send",
  "phone"   =>  "77000000000",
  "text"    =>  "Сообщение",
  "file_url" => "https://secure.gravatar.com/avatar/7cab71edb0a4c12a1e64bbfdf46a3c64",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
                                
const data = {
  json_data: JSON.stringify({
    method: "whatsapp_send",
    phone: "77000000000",
    text: "Сообщение",
    file_url: "https://secure.gravatar.com/avatar/7cab71edb0a4c12a1e64bbfdf46a3c64",
    api_id: "<app id>"
  })
};

fetch("https://api.sendapi.net", {
  method: "POST",
  headers: {
    "Content-Type": "application/x-www-form-urlencoded"
  },
  body: new URLSearchParams(data)
})
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.error("Error:", error));
                                
import requests
import json

data = {
    'json_data': json.dumps({
        'method': 'whatsapp_send',
        'phone': '77000000000',
        'text': 'Сообщение',
        'file_url': 'https://secure.gravatar.com/avatar/7cab71edb0a4c12a1e64bbfdf46a3c64',
        'api_id': '<app id>'
    })
}

response = requests.post('https://api.sendapi.net', data=data)
result = response.json()
print(result)
                                
Address:
https://api.sendapi.net
Method:
POST
Parameters for json_data:
Parameter Required Description
method whatsapp_send Send a Whatsapp message
phone yes Recipient phone number or Whatsapp group ID
text yes Message text in UTF-8 encoding
api_id yes Your API key
Response to a successful request:

A successful request returns the ID of the sent message, which can later be used to get its status.

{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}
Code examples:
$file_path = 'absolute path /12019526947.jpg';

if (function_exists('curl_file_create')) { // php 5.5+
  $cFile = curl_file_create($file_path);
} else {
  $cFile = '@' . realpath($file_path);
}
$data['json_data'] = json_encode([
  'method' => 'whatsapp_send',
  'phone'  => '77000000000',
  'text'   => 'файл 3',
  'api_id' => '<app id>'
]);
$data['file'] = $cFile;

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
                                
const formData = new FormData();
const fileInput = document.getElementById('fileInput'); // HTML input type="file"

formData.append('json_data', JSON.stringify({
  method: 'whatsapp_send',
  phone: '77000000000',
  text: 'файл 3',
  api_id: '<app id>'
}));
formData.append('file', fileInput.files[0]);

fetch('https://api.sendapi.net', {
  method: 'POST',
  body: formData
})
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.error('Error:', error));
                                
import requests
import json

file_path = '/path/to/your/file.jpg'

data = {
    'json_data': json.dumps({
        'method': 'whatsapp_send',
        'phone': '77000000000',
        'text': 'файл 3',
        'api_id': '<app id>'
    })
}

files = {
    'file': open(file_path, 'rb')
}

response = requests.post('https://api.sendapi.net', data=data, files=files)
result = response.json()
print(result)
                                
Address:
https://api.sendapi.net
Method:
POST
Parameters for file:
Data of the transferred file
Parameters for json_data:
Parameter Required Description
method whatsapp_send Send a Whatsapp message
phone yes Recipient phone number
text no Message text in UTF-8 encoding
api_id yes Your API key
Response to a successful request:

A successful request returns the ID of the sent message, which can later be used to get its status.

{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

Example of sending a message via HTTP:

https://api.sendapi.net?json_data={"method":"whatsapp_mailing","name":"Рассылка из API","text":"Тестовое сообщение","file_url":"https://api.sendapi.net/img/kp6.png","filter":{"phones":[77000000000,77000000001]},"api_id":"<app id>"}
Code examples:
$data['json_data'] = json_encode([
  "method"  =>  "whatsapp_mailing",
  "name"    =>  "Рассылка из API",
  "text"    =>  "Тестовое сообщение",
  "file_url" => "https://api.sendapi.net/img/kp6.png",
  "filter"  => ["phones" => [77000000000,77000000001]],
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
                                
const data = {
  json_data: JSON.stringify({
    method: "whatsapp_mailing",
    name: "Рассылка из API",
    text: "Тестовое сообщение",
    file_url: "https://api.sendapi.net/img/kp6.png",
    filter: {
      phones: [77000000000, 77000000001]
    },
    api_id: "<app id>"
  })
};

fetch("https://api.sendapi.net", {
  method: "POST",
  headers: {
    "Content-Type": "application/x-www-form-urlencoded"
  },
  body: new URLSearchParams(data)
})
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.error("Error:", error));
                                
import requests
import json

data = {
    'json_data': json.dumps({
        'method': 'whatsapp_mailing',
        'name': 'Рассылка из API',
        'text': 'Тестовое сообщение',
        'file_url': 'https://api.sendapi.net/img/kp6.png',
        'filter': {
            'phones': [77000000000, 77000000001]
        },
        'api_id': '<app id>'
    })
}

response = requests.post('https://api.sendapi.net', data=data)
result = response.json()
print(result)
                                
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_mailing Send a Whatsapp broadcast
name yes Broadcast name
text yes (required if file_url is not specified) Message text in UTF-8 encoding. Limit: from 10 to 2000 characters
file_url yes (required if text is not specified) File link
filter yes Filter, data in JSON format, the JSON must not be empty. Available parameters:
• phones - array of phone numbers, minimum 2 numbers: [77010000000,77010000001];
• category - "all" or category id;
• date_registration - date the number was added, in JSON format: {"from":"2019-01-01 00:00:00","to":"2019-01-31 23:59:59"};
• date_active - date of number activity, in JSON format: {"from":"2019-01-01 00:00:00","to":"2019-01-31 23:59:59"};

The phones parameter has priority: if it is specified, other parameters are not used for filtering
The broadcast is sent only to numbers with the Subscribed status

Examples:
{"category":"all","date_registration":{"from":"2019-01-01 00:00:00","to":"2019-01-31 23:59:59"}
{"phones":[77010000000,77010000001]}
{"category":"all"}
send_date no Date when the broadcast should be launched [format: 2019-02-03 00:00:00]. If not passed, the broadcast starts immediately
api_id yes Your API key
Response to a successful request:

A successful request returns the ID of the sent message, which can later be used to get its status.

{
  "result":0,
  "mailing_id":1
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}
Code examples:
$file_path = 'absolute path /12015426947.jpg';

if (function_exists('curl_file_create')) { // php 5.5+
  $cFile = curl_file_create($file_path);
} else {
  $cFile = '@' . realpath($file_path);
}
$data['json_data'] = json_encode([
  'method'        => 'whatsapp_send_contact_card',
  'phone'         => '77000000000',
  'api_id'        => '<app id>',
  'contact_phone' => '77000000000',
  'contact_name'  => 'Имя контакта',
  'file_url'      => 'https://api.sendapi.net/img/kp6.png',
]);
$data['contact_logo_image'] = $cFile;

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
                                
const formData = new FormData();

formData.append('json_data', JSON.stringify({
  method: 'whatsapp_send_contact_card',
  phone: '77000000000',
  api_id: '<app id>',
  contact_phone: '77000000000',
  contact_name: 'Имя контакта',
  file_url: 'https://api.sendapi.net/img/kp6.png'
}));

// If there is a contact logo file
const fileInput = document.getElementById('logoInput');
if (fileInput && fileInput.files[0]) {
  formData.append('contact_logo_image', fileInput.files[0]);
}

fetch('https://api.sendapi.net', {
  method: 'POST',
  body: formData
})
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.error('Error:', error));
                                
import requests
import json

data = {
    'json_data': json.dumps({
        'method': 'whatsapp_send_contact_card',
        'phone': '77000000000',
        'api_id': '<app id>',
        'contact_phone': '77000000000',
        'contact_name': 'Имя контакта',
        'file_url': 'https://api.sendapi.net/img/kp6.png'
    })
}

# If there is a contact logo file
files = {}
logo_path = '/path/to/contact/logo.jpg'  # path to the logo file
try:
    files['contact_logo_image'] = open(logo_path, 'rb')
except FileNotFoundError:
    pass

response = requests.post('https://api.sendapi.net', data=data, files=files)
result = response.json()
print(result)
                                
Address:
https://api.sendapi.net
Method:
POST
Parameters for file:
Data of the transferred file
Parameters for json_data:
Parameter Required Description
method whatsapp_send_contact_card Send a Whatsapp message
phone yes Recipient phone number
contact_phone yes Phone number passed in the contact
contact_name yes Contact name
logo_id yes, if the contact_logo_image parameter is not specified Logo ID, which becomes known after the logo is uploaded via the contact_logo_image parameter. [Parameter is deprecated, use file_url]
file_url yes, if the contact_logo_image parameter is not specified Image URL. Image format: jpg, jpeg, png. Example: https://api.sendapi.net/img/kp6.png
api_id yes Your API key
Parameters for contact_logo_image:
contact_logo_image yes, if the logo_id parameter is not specified; if logo_id is specified, the uploaded file will be ignored. Attention: only the jpg, jpeg image format is allowed for sending. Parameter into which the file must be uploaded
Response to a successful request:

On success, only the sending status is returned.

{
  "result":0,
}
Response to a successful request when contact_logo_image is passed:

On success, the sending status and the logo ID are returned; the ID can then be used in the logo_id parameter.

{
  "result":0,
  "logo_id":"100"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

Example of sending a message via HTTP:

https://api.sendapi.net?json_data={"method":"whatsapp_send_geolocation","phone":"77000000000","latitude":"53.284461","longitude":"69.378938","altitude":"5.5","accurate":"5.5","api_id":"<app id>"}
Code examples:
$data['json_data'] = json_encode([
  "method"     =>  "whatsapp_send_geolocation",
  "phone"      =>  "77000000000",
  "latitude"   =>  "53.284461",
  "longitude"  =>  "69.378938",
  "altitude"   =>  "5.5",
  "accurate"   =>  "5.5",
  "api_id"     =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
                                
const data = {
  json_data: JSON.stringify({
    method: "whatsapp_send_geolocation",
    phone: "77000000000",
    latitude: "53.284461",
    longitude: "69.378938",
    altitude: "5.5",
    accurate: "5.5",
    api_id: "<app id>"
  })
};

fetch("https://api.sendapi.net", {
  method: "POST",
  headers: {
    "Content-Type": "application/x-www-form-urlencoded"
  },
  body: new URLSearchParams(data)
})
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.error("Error:", error));
                                
import requests
import json

data = {
    'json_data': json.dumps({
        'method': 'whatsapp_send_geolocation',
        'phone': '77000000000',
        'latitude': '53.284461',
        'longitude': '69.378938',
        'altitude': '5.5',
        'accurate': '5.5',
        'api_id': '<app id>'
    })
}

response = requests.post('https://api.sendapi.net', data=data)
result = response.json()
print(result)
                                
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_send Send a Whatsapp message
phone yes Recipient phone number
text yes Message text in UTF-8 encoding
api_id yes Your API key
Response to a successful request:

A successful request returns the ID of the sent message, which can later be used to get its status.

{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

Example of sending a message via HTTP:

https://api.sendapi.net?json_data={"method":"whatsapp_message_list","message_id":"0","limit":"100","api_id":"<app id>"}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"      =>  "whatsapp_message_list",
  "message_id"  =>  "0",
  "limit"       =>  "100",
  "api_id"      =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_message_list Get the Whatsapp message list
message_id no Message ID. Default is 0.
phone no Phone number
limit no Number of records per request. Default is 50.
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "result_data":[{
              "message_id":1,
              "message_route":"inbox",
              "message_type":"message-chat",
              "message_text":"123",
              "message_quoted":null,
              "phone":"7700****000",
              "file_url":null,
              "phone_id":426,
              "add_date":"2019-11-28 16:44:09",
              "transport_ph_numb":777****6224,
              "referral":null}]
}

referral — a transition from a Click-to-WhatsApp ad: ad ID, click ID and ad data; null — the message is not from an ad. Object fields — as in Webhook.

Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

Example of sending a message via HTTP:

https://api.sendapi.net?json_data={"method":"whatsapp_message_get","message_id":"1","api_id":"<app id>"}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"      =>  "whatsapp_message_get",
  "message_id"  =>  "1",
  "api_id"      =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_message_get Get the message status
message_id yes Message number
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "result_data":[data array]
}

An array element has the same fields as whatsapp_message_list, including referral — a transition from a Click-to-WhatsApp ad (null — the message is not from an ad; object fields — as in Webhook).

Response to an unsuccessful request:
{
  "result":1,
  "result_description":"Параметр method не передан."
}

Example of sending a message via HTTP:

https://api.sendapi.net?json_data={"method":"whatsapp_phone_list","phone_id":"0","limit":"100","api_id":"<app id>"}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"    =>  "whatsapp_phone_list",
  "phone_id"  =>  "0",
  "limit"     =>  "100",
  "api_id"    =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_phone_list Get the Whatsapp message list
phone_id no Phone ID. Default is 0.
limit no Number of records per request. Default is 50.
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "result_data":[data array]
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

Example of sending a message via HTTP:

https://api.sendapi.net?json_data={"method":"whatsapp_phone_add","phone":"77000000000","name":"Имя","contact_company":"0","api_id":"<app id>"}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "whatsapp_phone_add",
  "phone"   =>  "77000000000",
  "name"    =>  "Имя",
  "contact_company" => "0",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_phone_get Get the message status
phone yes Subscriber Number
name no Subscriber name
contact_company no Whether to send the company contact to the user. 1 - send, 0 - do not send
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "result_data":[data array]
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

Example of sending a message via HTTP:

https://api.sendapi.net?json_data={"method":"whatsapp_phone_get","phone":"77000000000","api_id":"<app id>"}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "whatsapp_phone_get",
  "phone"   =>  "77000000000",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_phone_get Get the message status
phone yes Subscriber Number
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "result_data":[data array]
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

Example of sending a message via HTTP:

https://api.sendapi.net?json_data={"method":"whatsapp_unsubscribe","phone":"77000000000","api_id":"<app id>"}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "whatsapp_unsubscribe",
  "phone"   =>  "77000000000",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_unsubscribe Unsubscribe a subscriber from broadcasts
phone yes Subscriber Number
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "result_description":"Подписчик отписан."
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

Example of sending a message via HTTP:

https://api.sendapi.net?json_data={"method":"whatsapp_group_list","api_id":"<app id>"}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "whatsapp_group_list",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_group_list Get the list of whatsapp groups
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "groups": [
    {
      "adminCheck":false,
      "admins":["77*********"],
      "subscribers":["77*********","77*********","77*********"],
      "group_id":"whatsapp_group_********-********",
      "name":"Тест группа"
    }
  ]
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

Example of sending a message via HTTP:

https://api.sendapi.net?json_data={"method":"whatsapp_group_get","group_id":"whatsapp_group_*******","api_id":"<app id>"}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "whatsapp_group_get",
  "group_id"=>  "whatsapp_group_*******",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_group_get Get a whatsapp group
group_id yes group id
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "group":{
    "adminCheck":false,
    "admins":["77*********"],
    "subscribers":["77*********","77*********","77*********"],
    "group_id":"whatsapp_group_********-********",
    "name":"Тест группа"
  }
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"     =>  "whatsapp_group_create",
  "sp_numb"    =>  "1",
  "group_name" =>  "Тест группа",
  "subscribers"=>  ['7700*******'],
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_group_create Create a whatsapp group. This method creates a task to create the group. The group appears only after the task is completed. Task execution time depends on the channel load.
sp_numb yes channel id, can be obtained via the whatsapp_sender_get method
group_name yes Group name
subscribers yes Array of subscribers
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "result_description":"Задача на создание группы подана успешно. Ожидайте появления группы в списке групп."
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"     =>  "whatsapp_group_contact_set",
  "group_id"   =>  "whatsapp_group_*******",
  "subscribers"=>  ['7700*******'],
  "api_id"     =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_group_contact_set This method creates a task to add subscribers to the group. Subscribers appear only after the task is completed. Task execution time depends on the channel load.
group_id yes group id
subscribers yes Array of subscribers
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "result_description":"Задача на добавление контактов в группу подана успешно."
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"     =>  "whatsapp_group_contact_del",
  "group_id"   =>  "whatsapp_group_*******",
  "subscribers"=>  ['7700*******'],
  "api_id"     =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_group_contact_del This method creates a task to remove subscribers from the group. Subscribers are removed only after the task is completed. Task execution time depends on the channel load.
group_id yes group id
subscribers yes Array of subscribers
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "result_description":"Задача на удаление контактов из группу подана успешно."
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"     =>  "whatsapp_group_contact_set_as_admin",
  "group_id"   =>  "whatsapp_group_*******",
  "subscriber" =>  "7700*******",
  "api_id"     =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_group_contact_set_as_admin This method creates a task to grant admin rights to a subscriber in the group. Task execution time depends on the channel load.
group_id yes group id
subscriber yes Subscriber Number
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "result_description":"Задача на добавление прав админа подана успешно."
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

Example of sending a message via HTTP:

https://api.sendapi.net?json_data={"method":"contact_add","phone":"77000000000","sp_numb":"0","name":"Имя","contact_company":"0","api_id":"<app id>"}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "contact_add",
  "phone"   =>  "77000000000",
  "sp_numb" =>  "0",
  "name"    =>  "Имя",
  "contact_company" => "0",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method contact_add Add a subscriber with a specified channel
phone yes Subscriber Number
sp_numb yes Channel id, can be obtained via the whatsapp_sender_get method
name no Subscriber name
contact_company no Whether to send the company contact to the user. 1 - send, 0 - do not send
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "phone" : "whatsapp_biz_77000000000", // Returns the number in a format depending on the channel
  "sp_numb" : 0,
  "result_description" : "Подписчик добавлен."
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

Example of sending a message via HTTP:

https://api.sendapi.net?json_data={"method":"whatsapp_sender_get","api_id":"<app id>"}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "whatsapp_sender_get",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_sender_get Get channel data
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "result_data":[]
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

Example of sending a message via HTTP:

https://api.sendapi.net?json_data={"method":"chat_work_list","api_id":"<app id>"}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "chat_work_list",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method chat_work_list Get the list of contacts in work
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "result_data":[]
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

Example of sending a message via HTTP:

https://api.sendapi.net?json_data={"method":"chat_work_update","phone":"77000000000","operator_id":"10","action":"chat_in_work","api_id":"<app id>"}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "chat_work_update",
  "phone"   =>  "77000000000",
  "operator_id" => "10",
  "action"  => "chat_in_work"
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method chat_work_update Take or close a dialog
phone yes Contact
operator_id yes Operator ID
action yes chat_in_work - Take into work, chat_out_of_work - close the dialog
api_id yes Your API key
Response to a successful request:
{
  "result":0,
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

Example of sending a message via HTTP:

https://api.sendapi.net?json_data={"method":"chat_operator_online","api_id":"<app id>"}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "chat_operator_online",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method chat_operator_online Get operators online
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "result_data":[]
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

Example of sending a message via HTTP:

https://api.sendapi.net?json_data={"method":"operation_mode","api_id":"<app id>"}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "operation_mode",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method operation_mode Get the operating mode
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "result_data":[]
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "instagram_send_text",
  "phone"   => "instagram_0000000000",
  "text"    => "Сообщение",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method instagram_send_text Send an instagram message
phone yes Instagram contact. Format: instagram_0000000000.
text yes Message text
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

1. Sending a file by link. PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "instagram_send_file",
  "phone"   => "instagram_0000000000",
  "file_url"=> "https://api.sendapi.net/img/kp6.png",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      

2. Sending as a file. PHP example (with the curl module enabled):


$file_path = 'absolute path /12019526947.jpg';

if (function_exists('curl_file_create')) { // php 5.5+
  $cFile = curl_file_create($file_path);
} else {
  $cFile = '@' . realpath($file_path);
}
$data['json_data'] = json_encode([
  'method' => 'instagram_send_file',
  'phone'  => 'instagram_0000000000',
  'api_id' => '<app id>'
]);
$data['file'] = $cFile;

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method instagram_send_file Send an instagram file
phone yes Instagram contact. Format: instagram_0000000000.
file_url yes File link, required if no file is attached to the request
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "telegram_send_text",
  "phone"   => "telegram_0000000000",
  "text"    => "Сообщение",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      

Sending the first message by @username

If the contact is not yet added to the channel, you can specify `tg_login` and `sp_numb` (channel identifier) instead of `phone`. The server will try to resolve `@username` via the Telegram gateway, automatically create/check the subscription in the specified `sp_numb`, and then send the message.

$data['json_data'] = json_encode([
    "method"  =>  "telegram_send_text",
    "sp_numb" => 123,
    "tg_login"=> "@username",
    "text"    => "Привет! Это первое сообщение.",
    "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
            

Notes:

  • Validation of `tg_login`: the login must match the pattern ^@[a-zA-Z][a-zA-Z0-9_]{4,31}$.
  • sp_numb is the channel identifier (phone_id / smap id). The specified channel must have a configured Telegram slot (tg_v2_slot_id).
  • If the message is not sent and an error code is returned, check that `tg_login` is correct, that the Telegram gateway is available, and that `sp_numb` is present.
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method telegram_send_text Send a telegram message
phone yes Telegram contact. Format: telegram_0000000000.
text yes Message text
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

1. Sending a file by link. PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "telegram_send_file",
  "phone"   => "telegram_0000000000",
  "file_url"=> "https://api.sendapi.net/img/kp6.png",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      

2. Sending as a file. PHP example (with the curl module enabled):


$file_path = 'absolute path /12019526947.jpg';

if (function_exists('curl_file_create')) { // php 5.5+
  $cFile = curl_file_create($file_path);
} else {
  $cFile = '@' . realpath($file_path);
}
$data['json_data'] = json_encode([
  'method' => 'telegram_send_file',
  'phone'  => 'telegram_0000000000',
  'api_id' => '<app id>'
]);
$data['file'] = $cFile;

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method telegram_send_file Send a telegram file
phone yes Telegram contact. Format: telegram_0000000000.
file_url yes File link, required if no file is attached to the request
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "vk_send_text",
  "phone"   => "vk_0000000000",
  "text"    => "Сообщение",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method vk_send_text Send vk message
phone yes vk contact. Format: vk_0000000000.
text yes Message text
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

1. Sending a file by link. PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "vk_send_file",
  "phone"   => "vk_0000000000",
  "file_url"=> "https://api.sendapi.net/img/kp6.png",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      

2. Sending as a file. PHP example (with the curl module enabled):


$file_path = 'absolute path /12019526947.jpg';

if (function_exists('curl_file_create')) { // php 5.5+
  $cFile = curl_file_create($file_path);
} else {
  $cFile = '@' . realpath($file_path);
}
$data['json_data'] = json_encode([
  'method' => 'vk_send_file',
  'phone'  => 'vk_0000000000',
  'api_id' => '<app id>'
]);
$data['file'] = $cFile;

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method vk_send_file Send vk file
phone yes vk contact. Format: vk_0000000000.
file_url yes File link, required if no file is attached to the request
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "facebook_send_text",
  "phone"   => "facebook_0000000000",
  "text"    => "Сообщение",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method facebook_send_text Send facebook message
phone yes facebook contact. Format: facebook_0000000000.
text yes Message text
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

1. Sending a file by link. PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "facebook_send_file",
  "phone"   => "facebook_0000000000",
  "file_url"=> "https://api.sendapi.net/img/kp6.png",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      

2. Sending as a file. PHP example (with the curl module enabled):


$file_path = 'absolute path /12019526947.jpg';

if (function_exists('curl_file_create')) { // php 5.5+
  $cFile = curl_file_create($file_path);
} else {
  $cFile = '@' . realpath($file_path);
}
$data['json_data'] = json_encode([
  'method' => 'facebook_send_file',
  'phone'  => 'facebook_0000000000',
  'api_id' => '<app id>'
]);
$data['file'] = $cFile;

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method facebook_send_file Send facebook file
phone yes facebook contact. Format: facebook_0000000000.
file_url yes File link, required if no file is attached to the request
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "yandex_send_text",
  "phone"   => "yandex_0000000000",
  "text"    => "Сообщение",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method yandex_send_text Send yandex message
phone yes yandex contact. Format: yandex_0000000000.
text yes Message text
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

1. Sending a file by link. PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "yandex_send_file",
  "phone"   => "yandex_0000000000",
  "file_url"=> "https://api.sendapi.net/img/kp6.png",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      

2. Sending as a file. PHP example (with the curl module enabled):


$file_path = 'absolute path /12019526947.jpg';

if (function_exists('curl_file_create')) { // php 5.5+
  $cFile = curl_file_create($file_path);
} else {
  $cFile = '@' . realpath($file_path);
}
$data['json_data'] = json_encode([
  'method' => 'yandex_send_file',
  'phone'  => 'yandex_0000000000',
  'api_id' => '<app id>'
]);
$data['file'] = $cFile;

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method yandex_send_file Send yandex file
phone yes yandex contact. Format: yandex_0000000000.
file_url yes File link, required if no file is attached to the request
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "viber_bot_send_text",
  "phone"   => "viber_bot_0000000000",
  "text"    => "Сообщение",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method viber_bot_send_text Send viber_bot message
phone yes viber_bot contact. Format: viber_bot_0000000000.
text yes Message text
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

1. Sending a file by link. PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "viber_bot_send_file",
  "phone"   => "viber_bot_0000000000",
  "file_url"=> "https://api.sendapi.net/img/kp6.png",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      

2. Sending as a file. PHP example (with the curl module enabled):


$file_path = 'absolute path /12019526947.jpg';

if (function_exists('curl_file_create')) { // php 5.5+
  $cFile = curl_file_create($file_path);
} else {
  $cFile = '@' . realpath($file_path);
}
$data['json_data'] = json_encode([
  'method' => 'viber_bot_send_file',
  'phone'  => 'viber_bot_0000000000',
  'api_id' => '<app id>'
]);
$data['file'] = $cFile;

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method viber_bot_send_file Send viber_bot file
phone yes viber_bot contact. Format: viber_bot_0000000000.
file_url yes File link, required if no file is attached to the request
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "sendapi_send_text",
  "phone"   => "sendapi_0000000000",
  "text"    => "Сообщение",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method sendapi_send_text Send sendapi message
phone yes sendapi contact. Format: sendapi_0000000000.
text yes Message text
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

1. Sending a file by link. PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "sendapi_send_file",
  "phone"   => "sendapi_0000000000",
  "file_url"=> "https://api.sendapi.net/img/kp6.png",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      

2. Sending as a file. PHP example (with the curl module enabled):


$file_path = 'absolute path /12019526947.jpg';

if (function_exists('curl_file_create')) { // php 5.5+
  $cFile = curl_file_create($file_path);
} else {
  $cFile = '@' . realpath($file_path);
}
$data['json_data'] = json_encode([
  'method' => 'sendapi_send_file',
  'phone'  => 'sendapi_0000000000',
  'api_id' => '<app id>'
]);
$data['file'] = $cFile;

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method sendapi_send_file Send sendapi file
phone yes sendapi contact. Format: sendapi_0000000000.
file_url yes File link, required if no file is attached to the request
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

A message can be sent within 24 hours after the last incoming message from the contact.

To find out whether 24 hours have passed and whether a message can still be sent, use the whatsapp_phone_get method, parameter inbox_time (time is shown in seconds).


PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "whatsapp_biz_send_text",
  "phone"   => "whatsapp_biz_0000000000",
  "text"    => "Сообщение",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_biz_send_text Send WhatsApp Business message
phone yes WhatsApp Business contact. Format: whatsapp_biz_0000000000.
text yes Message text
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

1. Sending a file by link. PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "whatsapp_biz_send_file",
  "phone"   => "whatsapp_biz_0000000000",
  "file_url"=> "https://api.sendapi.net/img/kp6.png",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      

2. Sending as a file. PHP example (with the curl module enabled):


$file_path = 'absolute path /12019526947.jpg';

if (function_exists('curl_file_create')) { // php 5.5+
  $cFile = curl_file_create($file_path);
} else {
  $cFile = '@' . realpath($file_path);
}
$data['json_data'] = json_encode([
  'method' => 'whatsapp_biz_send_file',
  'phone'  => 'whatsapp_biz_0000000000',
  'api_id' => '<app id>'
]);
$data['file'] = $cFile;

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_biz_send_file Send WhatsApp Business file
phone yes WhatsApp Business contact. Format: whatsapp_biz_0000000000.
file_url yes File link, required if no file is attached to the request
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "message_id":"1"
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "whatsapp_biz_template_list",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_biz_template_list Get WhatsApp Business templates
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "result_data":[
    {"sp_numb":0000,"phone_number":00000000000,"template_name":"template_1","template_message":"Сообщение","params_count":0}
  ]
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}
$data['json_data'] = json_encode([
  "method"  =>  "whatsapp_biz_template_send",
  "phone"   => "whatsapp_biz_0000000000",
  "template_name" => "template_1",
  "template_params" => ["текст"],
  "api_id" => "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method whatsapp_biz_template_send Send WhatsApp Business template
phone yes WhatsApp Business contact. Format: whatsapp_biz_0000000000.
template_name yes Template Name
template_params yes Additional template data
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "message_id":"1",
  "user_balance": 0
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

Returns the list of all active channels (numbers) of the account with safe data for all available transports.

HTTP request example:

https://api.sendapi.net?json_data={"method":"channels_list","api_id":"<app id>"}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "channels_list",
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method channels_list Get channel list
api_id yes Your API key
Fields in result_data:
Field Type Description
sp_numb int Channel ID (used in the sp_numb parameter when sending)
phone_number string Phone number / channel identifier
transport string Transport type: whatsapp, telegram, instagram, vk, facebook, viber_bot, other
active_status string Channel status (on - active)
priority int|null Channel priority (lower = higher priority)
Response to a successful request:
{
  "result": 0,
  "result_data": [
    {
      "sp_numb": 123,
      "transport": "whatsapp",
      "active_status": "on",
      "priority": 1
    },
    {
      "sp_numb": 456,
      "phone_number": "79007654321",
      "transport": "telegram",
      "active_status": "on",
      "priority": 2
    }
  ]
}
Response to an unsuccessful request (More):
{
  "result": 1,
  "result_description": "Параметр method не передан."
}
Code examples:
$data['json_data'] = json_encode([
  "method"  =>  "user_balance",
  "api_id" => "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
                                
const data = {
  json_data: JSON.stringify({
    method: "user_balance",
    api_id: "<app id>"
  })
};

fetch("https://api.sendapi.net", {
  method: "POST",
  headers: {
    "Content-Type": "application/x-www-form-urlencoded"
  },
  body: new URLSearchParams(data)
})
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.error("Error:", error));
                                
import requests
import json

data = {
    'json_data': json.dumps({
        'method': 'user_balance',
        'api_id': '<app id>'
    })
}

response = requests.post('https://api.sendapi.net', data=data)
result = response.json()
print(result)
                                
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method user_balance User balance
api_id yes Your API key
Response to a successful request:
{
  "result":0,
  "user_balance": 0
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

This method is also suitable for unblocking the API if it was blocked due to prolonged incorrect responses to requests to the webhook URL. The request must specify the status 'active'.

Example of sending a message via HTTP:

https://api.sendapi.net?json_data={"method":"webhook_status_update","status":"off","api_id":"<app id>"}

PHP example (with the curl module enabled):

$data['json_data'] = json_encode([
  "method"  =>  "webhook_status_update",
  "status"   =>  "off", // available statuses: 'active', 'off'
  "api_id"  =>  "<app id>"
]);

$ch = curl_init("https://api.sendapi.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$body = curl_exec($ch);
curl_close($ch);
      
Address:
https://api.sendapi.net
Method:
GET, POST
Parameters for json_data:
Parameter Required Description
method webhook_status_update Update webhook status
status yes Available statuses: active, timeout, off.
api_id yes Your API key
Response to a successful request:
{
  "result":0
}
Response to an unsuccessful request (More):
{
  "result":1,
  "result_description":"Параметр method не передан."
}

When errors occur, the API returns a JSON response with the result field not equal to 0 and an error description in the result_description field.

Error response example:
{
  "result": 1,
  "result_description": "Параметр method не передан."
}
General error handling principles:
  • Always check the result field in the response
  • When result != 0, handle the error according to the description in result_description
  • Implement retries for temporary errors (codes 42, 6, 72)
  • Check the correctness of the passed parameters before sending the request

Response options:

Response Description
0 Successful result
1 Error
11 Invalid method parameter.
2 The phone parameter is not provided.
21 Invalid phone parameter.
22 Subscriber not found.
23 Subscriber is unsubscribed or not processed.
24 Failed to update subscriber data.
3 The text parameter is not provided.
31 Invalid text parameter.
32 Message length exceeded. Maximum length is 2000 characters. Send large messages via POST.
4 The api_id parameter is not provided.
41 Invalid api_id parameter.
42 System error. Contact support.
5 The message_id parameter is not provided.
51 Invalid message_id parameter.
52 Failed to get the messages array.
6 Failed to create a message sending task.
61 Data not found.
62 You need to purchase or pay for a plan.
71 Senders not found.
72 Senders are overloaded.

Webhook

The Webhook link can be configured on the API Settings page

All events are sent using the POST method with the Content-Type: application/json header to the URL you specified. If an authorization token is set in the settings, it is passed in the Authorization HTTP header. The event type is determined by the callback_status field. The fields transport, phone_id, user_id, add_date, reverse_date are present in all events.

Actions that trigger the Webhook:

New incoming message POST <Your webhook url>
Content-Type: application/json
Parameter Value/Type Description
callback_status new_inbox_message Action type. New incoming message
phone string Phone number
transport string Communication channel whatsapp
phone_number string Gateway number connected to the system
phone_id int ID of the gateway connected to the system
message_id int Message ID
message_data Array Message data array (last message). Element fields:
FieldTypeDescription
message_idintMessage ID
message_routestringDirection: inbox / outbox
message_typestringMessage type (message-chat, image, file, etc.)
message_textstringMessage text
message_quotedstring|nullQuoted message (if any)
phonestringContact phone number
sp_numbintSender gateway ID
file_urlstring|nullAttachment link (if any)
transportstringCommunication channel
add_dateISODateMessage date
referral object|null Ad referral: the client wrote by clicking a Click-to-WhatsApp ad (Instagram, Facebook). null - the message is not from an ad, and all outgoing messages. The object is present only in the client message that started the conversation (text, photo, voice); the ad image, which the system adds as a separate message on WhatsApp app numbers, does not have it - one click corresponds to one message with referral. Field names are the same as in the referral object of the Meta WhatsApp Cloud API. Any field can be null: WhatsApp does not always fill them in. On WhatsApp Business API (WABA) numbers the object is the same, the data is provided by Meta: source_app is always null, ctwa_clid is null for ads in WhatsApp statuses.
FieldTypeDescription
source_typestring|nullReferral source: ad - advertisement
source_idstring|nullAd ID in Meta (as a string: an 18-digit number)
source_urlstring|nullLink to the ad or post
source_appstring|nullWhere the ad was shown: instagram, facebook, whatsapp (for WABA - always null)
ctwa_clidstring|nullAd click ID (Click-to-WhatsApp click ID)
headlinestring|nullAd headline
bodystring|nullAd text
media_typestring|nullAd media: image or video
thumbnail_urlstring|nullAd image or video preview (link to the Meta CDN, stops opening after some time)
"referral": {
  "source_type": "ad",
  "source_id": "120200000000000000",
  "source_url": "https://www.instagram.com/p/EXAMPLE/",
  "source_app": "instagram",
  "ctwa_clid": "ARAkExampleClickId...",
  "headline": "Напишите нам",
  "body": "Текст объявления",
  "media_type": "image",
  "thumbnail_url": "https://scontent.xx.fbcdn.net/..."
}
user_id int Client ID in the system
add_date ISODate Date Added
reverse_date ISODate Date Added
New outgoing message POST <Your webhook url>
Content-Type: application/json
Parameter Value/Type Description
callback_status new_outbox_message Action type. A new outgoing message was sent
phone string Contact phone number
transport string Communication channel (whatsapp / telegram / instagram, etc.)
phone_number string Number of the gateway connected to the system
phone_id int ID of the gateway connected to the system
message_id int Message ID
message_data Array Message data array (structure is the same as for an incoming message)
user_id int Client ID in the system
add_date ISODate Date Added
reverse_date ISODate Date Added
New subscriber (contact) POST <Your webhook url>
Content-Type: application/json
Parameter Value/Type Description
callback_status new_subscriber Action type. A new contact/subscriber appeared
phone string Contact phone number
transport string Communication channel
phone_number string Number of the gateway connected to the system
phone_id int ID of the gateway connected to the system
user_id int Client ID in the system
add_date ISODate Date Added
reverse_date ISODate Date Added
Gateway number change POST <Your webhook url>
Content-Type: application/json
Parameter Value/Type Description
callback_status whatsapp_change_gateway_ph_number Action type. The gateway phone number has changed
phone string Contact phone number (if applicable)
transport string Communication channel
phone_number string New number of the gateway connected to the system
phone_id int ID of the gateway connected to the system
user_id int Client ID in the system
add_date ISODate Date Added
reverse_date ISODate Date Added
Taken into work / Dialog finished POST <Your webhook url>
Content-Type: application/json
Parameter Value/Type Description
callback_status chat_in_work/chat_out_of_work Action type. chat_in_work - taken into work. chat_out_of_work - dialog finished
phone string Phone number
transport string Communication channel whatsapp
phone_number string Gateway number connected to the system
phone_id int ID of the gateway connected to the system
hook_body_row json {operator_id:1}. Operator ID
user_id int Client ID in the system
add_date ISODate Date Added
reverse_date ISODate Date Added
Message delivery statuses for WhatsApp POST <Your webhook url>
Content-Type: application/json
Parameter Value/Type Description
callback_status set_delivery_status Action type. The delivery status of the sent message has changed
delivery_status string

Delivery status to numbers

Value Description
4 Message sent
5 Message delivered
13 Message read

Delivery status to groups

Value Description
4 Message sent to the numbers of all participants
5 Message delivered to the numbers of all participants
13 Message read by all group participants
phone string Phone number
transport string WhatsApp communication channel
phone_number string Gateway number connected to the system
phone_id int ID of the gateway connected to the system
user_id int Client ID in the system
add_date ISODate Date Added
reverse_date ISODate Date Added
amoCRM deal events (Meta Conversions API) POST <Your webhook url>
Content-Type: application/json
Enabled by the “Deal webhooks” toggle in the API Settings → AmoCRM section. The webhook link and token are taken from the “Webhook setup” section (SendAPI). Convenient for sending Lead (deal created) and Purchase (successful deal) events to the Meta Conversions API.
Parameter Value/Type Description
callback_status deal_created / deal_status_changed Action type. deal_created - deal created. deal_status_changed - deal status changed
phone string Deal contact phone (for matching with a person in Meta CAPI)
transport string sendapi (CRM event, not tied to a messaging channel)
user_id int Client ID in the system
hook_body_row json Deal data:
Field Type Description
crmstringAlways "amocrm"
eventstringdeal_created / deal_status_changed
deal_idintDeal ID in amoCRM
pipeline_idint|nullPipeline ID
status_idint|nullCurrent deal status
old_status_idint|nullPrevious status (only for deal_status_changed)
pricenumber|nullDeal amount
is_wonbooltrue if status = “successfully completed” (142). Flag for Purchase
responsible_user_idint|nullResponsible manager ID
namestring|nullDeal name
add_date ISODate Date Added
reverse_date ISODate Date Added
Loading...