Documentation API version 1.0

You can access the api version 1 documentation at this link

Documentation API Gateway

Last Update: 24 Sept 2020

Welcome Back

Intro

WABLAS is WhatsApp API gateway service for sending and receiving messages, notification, scheduler, reminder, group message, tracking, and chatbots with simple integration for your business

Our API was designed to be extremely easy to use and accessible to everyone, no matter the programing language or frameworks you use

Step 1: Whatsapp Number Verification for Sender

  1. Select Device menu then click Scan QR Code Icon.
  2. Please wait a moment, the qr code image will appear immediately. then you can do a scan with the whatsapp application
  3. Please wait about 5 minutes, You will get a WhatsApp notification if your device is connected to Wablas.
  4. If you successfully scan the QR Code and after 5 minutes can't connected, please contact us (IT support).
  5. If the service is active you can send text messages or images, with the API that we have provided.

Note:

  1. Prohibited from accessing the website https://web.whatsapp.com
  2. If you log out of your WhatsApp application or change WhatsApp number, make sure to scan the QR code again

API v2

Domain for sending messages, according to each server where the service is registered

Send Bulk Text

You can send bulk text messages to personal number with one click

POST/api/v2/send-bulk/text
<?php
$curl = curl_init();
$token = "";
$payload = [
    "data" => [
        [
            'phone' => '081xxx',
            'message' => 'try message 1'
        ],
        [
            'phone' => '085xxx',
            'message' => 'try message 2'
        ],
        ...
    ]
];

curl_setopt($curl, CURLOPT_HTTPHEADER,
    array(
        "Authorization: $token",
        "Content-Type: application/json"
    )
);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($payload) );
curl_setopt($curl, CURLOPT_URL, "{ domain_api }/api/v2/send-bulk/text");
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($curl);
curl_close($curl);

echo "<pre>";
print_r($result);

?>
Request parameters:
Authorization Required Your Token from https://console.wablas.com, can be seen in the menu: Device - Setting
phone Required Target phone number. You can use the country code prefix or not. Example: 081223xxxx
message Required Text message to be sent. Format: UTF-8 or UTF-16 string. for single newline (\n1), double newline (\n2)

Response:


{
    "status": true,
    "message": "successfully sent text",
    "data": {
        "quota": "unlimited",
        "message": [
            {
                "id": "STRKW2dy5b3Qq60Hi3e9RCund1PS6lZ9",
                "phone": "081xxx",
                "message": "try message 1",
                "status": "pending"
            },
            {
                "id": "STR282xxHkl0lxaLiaHlpVLh50km0k78",
                "phone": "085xxx",
                "message": "try message 2",
                "status": "pending"
            }
        ]
    }
}
                                        

Send Bulk Text for Group

You can send bulk text message to whatsapp group with one click

POST/api/v2/send-bulk/text-group
<?php
$curl = curl_init();
$token = "";
$payload = [
    "data" => [
        [
            'groupId' => '154xxxxx',
            'phone' => '081xxx',
            'message' => 'try message 1'
        ],
        [
            'groupId' => '154xxxxx',
            'phone' => '085xxx',
            'message' => 'try message 2'
        ],
        ...
    ]
];

curl_setopt($curl, CURLOPT_HTTPHEADER,
    array(
        "Authorization: $token",
        "Content-Type: application/json"
    )
);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($payload) );
curl_setopt($curl, CURLOPT_URL, "{ domain_api }/api/v2/send-bulk/text-group");
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($curl);
curl_close($curl);

echo "<pre>";
print_r($result);

?>
Request parameters:
Authorization Required Your Token from https://console.wablas.com, can be seen in the menu: Device - Setting
phone Required Target phone number. You can use the country code prefix or not. Example: 081223xxxx
message Required Text message to be sent. Format: UTF-8 or UTF-16 string. for single newline (\n1), double newline (\n2)

Response:


{
    "status": true,
    "message": "successfully sent text",
    "data": {
        "quota": "unlimited",
        "message": [
            {
                "id": "STRKW2dy5b3Qq60Hi3e9RCund1PS6lZ9",
                "phone": "081xxx",
                "message": "try message 1",
                "status": "pending"
            },
            {
                "id": "STR282xxHkl0lxaLiaHlpVLh50km0k78",
                "phone": "085xxx",
                "message": "try message 2",
                "status": "pending"
            }
        ]
    }
}
                                        

Send Bulk Image

You can send bulk image messages to personal number with one click

POST/api/v2/send-bulk/image
<?php
$curl = curl_init();
$token = "";
$payload = [
    "data" => [
        [
            'phone' => '081xxx',
            'caption' => 'caption image 1',
            'image' => 'https://xxxx.com/poster1.jpeg',
            'secret' => false, // or true
            'priority' => false, // or true
            'category' => 'image' // or text
        ],
        [
            'phone' => '081xxx',
            'caption' => 'caption image 2',
            'image' => 'https://xxxx.com/poster2.jpeg',
            'secret' => false, // or true
            'priority' => false, // or true
            'category' => 'image' // or text
        ],
        [
            'phone' => '085xxx',
            'message' => 'message 3',
            'secret' => false, // or true
            'priority' => false, // or true
            'category' => 'text' // or image
        ],
        ...
    ]
];

curl_setopt($curl, CURLOPT_HTTPHEADER,
    array(
        "Authorization: $token",
        "Content-Type: application/json"
    )
);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($payload) );
curl_setopt($curl, CURLOPT_URL, "{ domain_api }/api/v2/send-bulk/image");
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($curl);
curl_close($curl);

echo "<pre>";
print_r($result);

?>
Request parameters:
Authorization Required Your Token from https://console.wablas.com, can be seen in the menu: Device - Setting
phone Required Target phone number. You can use the country code prefix or not. Example: 081223xxxx
caption Optional Text image must on the format: UTF-8 or UTF-16 string. maximum 700 character
image Required URL of image file to be sent. Make sure the image has been uploaded on the server and can be accessed by the public.
support extension jpg, jpeg, png, gif

Response:


{
    "status": true,
    "message": "successfully sent text",
    "data": {
        "quota": "unlimited",
        "message": [
            {
                "id": "STRKW2dy5b3Qq60Hi3e9RCund1PS6lZ9",
                "phone": "081xxx",
                "caption": "caption image 1",
                'image': 'https://xxxx.com/poster1.jpeg',
                "status": "pending"
            },
            {
                "id": "DSADSTRKW2dyHi3e9RCund1PS6lDSADA",
                "phone": "081xxx",
                "caption": "caption image 2",
                'image': 'https://xxxx.com/poster2.jpeg',
                "status": "pending"
            },
            {
                "id": "DSFKLOROIW4LWROI2332MKL234OIR9ASD",
                "phone": "085xxx",
                "message": "message 2",
                "status": "pending"
            }
        ]
    }
}
                                        

Send Bulk Image for Group

You can send bulk image to a group to whatsapp group with one click

POST/api/v2/send-bulk/image-group
<?php
$curl = curl_init();
$token = "";
$payload = [
    "data" => [
        [
            'groupId' => '154xxxxx',
            'phone' => '081xxx',
            'caption' => 'try message 1',
            'image' => 'https://xxxx.com/poster1.jpeg',
            'secret' => false, // or true
            'priority' => false, // or true
        ],
        [
            'groupId' => '154xxxxx',
            'phone' => '085xxx',
            'caption' => 'try message 2',
            'image' => 'https://xxxx.com/poster2.jpeg',
            'secret' => false, // or true
            'priority' => false, // or true
        ],
        ...
    ]
];

curl_setopt($curl, CURLOPT_HTTPHEADER,
    array(
        "Authorization: $token",
        "Content-Type: application/json"
    )
);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($payload) );
curl_setopt($curl, CURLOPT_URL, "{ domain_api }/api/v2/send-bulk/image-group");
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($curl);
curl_close($curl);

echo "<pre>";
print_r($result);

?>
Request parameters:
Authorization Required Your Token from https://console.wablas.com, can be seen in the menu: Device - Setting
phone Required Target phone number. You can use the country code prefix or not. Example: 081223xxxx
caption Optional Text image must on the format: UTF-8 or UTF-16 string. maximum 700 character
image Required URL of image file to be sent. Make sure the image has been uploaded on the server and can be accessed by the public.
support extension jpg, jpeg, png, gif

Response:


{
    "status": true,
    "message": "successfully sent text",
    "data": {
        "quota": "unlimited",
        "message": [
            {
                "id": "STRKW2dy5b3Qq60Hi3e9RCund1PS6lZ9",
                'groupId': '154xxxxx',
                "phone": "081xxx",
                "caption": "try message 1",
                'image': 'https://xxxx.com/poster1.jpeg',
                "status": "pending"
            },
            {
                "id": "STR282xxHkl0lxaLiaHlpVLh50km0k78",
                'groupId': '154xxxxx',
                "phone": "085xxx",
                "caption": "try message 2",
                'image': 'https://xxxx.com/poster2.jpeg',
                "status": "pending"
            }
        ]
    }
}
                                        

Resend Whatsapp Message By ID

resend whatsapp message by id

GETapi/v2/resend-message?token={your-token}&id={xxx}
<?php
$resutl = file_get_contents("{ domain_api }/api/v2/resend-message?token=xxxxx&id=STRp02W0v3t1j2t92809Gv2X066Oc6Et")

echo "<pre>";
print_r($result);

?>

Response:


{
    "status": true,
    "message": "resend message successfully",
}