cURL
curl -X POST \
'https://dashboard.whatsable.app/api/whatsapp/messages/v2.0.0/send' \
-H 'Authorization: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"to": "+1234567890",
"text": "Hello, this is a test message from WhatsAble!"
}'const axios = require('axios');
const sendMessage = async () => {
try {
const response = await axios.post(
'https://dashboard.whatsable.app/api/whatsapp/messages/v2.0.0/send',
{
to: '+1234567890',
text: 'Hello, this is a test message from WhatsAble!'
},
{
headers: {
'Authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
);
console.log(response.data);
} catch (error) {
console.error(error.response.data);
}
};
sendMessage();import requests
def send_message():
url = 'https://dashboard.whatsable.app/api/whatsapp/messages/v2.0.0/send'
headers = {
'Authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
data = {
'to': '+1234567890',
'text': 'Hello, this is a test message from WhatsAble!'
}
try:
response = requests.post(url, headers=headers, json=data)
response.raise_for_status()
print(response.json())
except requests.exceptions.RequestException as e:
print(f'Error: {e.response.json() if e.response else e}')package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
type Message struct {
To string `json:"to"`
Text string `json:"text"`
}
func main() {
url := "https://dashboard.whatsable.app/api/whatsapp/messages/v2.0.0/send"
message := Message{
To: "+1234567890",
Text: "Hello, this is a test message from WhatsAble!",
}
jsonData, err := json.Marshal(message)
if err != nil {
fmt.Printf("Error marshaling JSON: %v\n", err)
return
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
if err != nil {
fmt.Printf("Error creating request: %v\n", err)
return
}
req.Header.Set("Authorization", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Printf("Error making request: %v\n", err)
return
}
defer resp.Body.Close()
var result map[string]interface{}
if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
fmt.Printf("Error decoding response: %v\n", err)
return
}
fmt.Printf("Response: %+v\n", result)
}<?php
$url = 'https://dashboard.whatsable.app/api/whatsapp/messages/v2.0.0/send';
$data = [
'to' => '+1234567890',
'text' => 'Hello, this is a test message from WhatsAble!'
];
$options = [
'http' => [
'header' => [
'Authorization: YOUR_API_KEY',
'Content-Type: application/json'
],
'method' => 'POST',
'content' => json_encode($data)
]
];
$context = stream_context_create($options);
try {
$result = file_get_contents($url, false, $context);
$response = json_decode($result, true);
print_r($response);
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}require 'net/http'
require 'json'
require 'uri'
url = URI('https://dashboard.whatsable.app/api/whatsapp/messages/v2.0.0/send')
data = {
to: '+1234567890',
text: 'Hello, this is a test message from WhatsAble!'
}
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request['Authorization'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = data.to_json
begin
response = http.request(request)
puts JSON.parse(response.body)
rescue => e
puts "Error: #{e.message}"
endimport java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import org.json.JSONObject;
public class WhatsAbleClient {
public static void main(String[] args) {
try {
HttpClient client = HttpClient.newHttpClient();
JSONObject data = new JSONObject();
data.put("to", "+1234567890");
data.put("text", "Hello, this is a test message from WhatsAble!");
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://dashboard.whatsable.app/api/whatsapp/messages/v2.0.0/send"))
.header("Authorization", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(data.toString()))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
} catch (Exception e) {
System.out.println("Error: " + e.getMessage());
}
}
}{
"success": true,
"message": "<string>",
"details": {
"messages": [
{
"id": "<string>",
"message_status": "<string>"
}
]
}
}{
"success": false,
"message": "<string>",
"details": "<string>"
}{
"success": false,
"message": "<string>",
"details": "<string>"
}{
"success": false,
"message": "<string>",
"details": "<string>"
}{
"success": false,
"message": "<string>",
"details": "<string>"
}Messages
Send a WhatsApp message
Send a WhatsApp message with optional attachments (images, videos, documents)
POST
/
send
cURL
curl -X POST \
'https://dashboard.whatsable.app/api/whatsapp/messages/v2.0.0/send' \
-H 'Authorization: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"to": "+1234567890",
"text": "Hello, this is a test message from WhatsAble!"
}'const axios = require('axios');
const sendMessage = async () => {
try {
const response = await axios.post(
'https://dashboard.whatsable.app/api/whatsapp/messages/v2.0.0/send',
{
to: '+1234567890',
text: 'Hello, this is a test message from WhatsAble!'
},
{
headers: {
'Authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
);
console.log(response.data);
} catch (error) {
console.error(error.response.data);
}
};
sendMessage();import requests
def send_message():
url = 'https://dashboard.whatsable.app/api/whatsapp/messages/v2.0.0/send'
headers = {
'Authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
data = {
'to': '+1234567890',
'text': 'Hello, this is a test message from WhatsAble!'
}
try:
response = requests.post(url, headers=headers, json=data)
response.raise_for_status()
print(response.json())
except requests.exceptions.RequestException as e:
print(f'Error: {e.response.json() if e.response else e}')package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
type Message struct {
To string `json:"to"`
Text string `json:"text"`
}
func main() {
url := "https://dashboard.whatsable.app/api/whatsapp/messages/v2.0.0/send"
message := Message{
To: "+1234567890",
Text: "Hello, this is a test message from WhatsAble!",
}
jsonData, err := json.Marshal(message)
if err != nil {
fmt.Printf("Error marshaling JSON: %v\n", err)
return
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
if err != nil {
fmt.Printf("Error creating request: %v\n", err)
return
}
req.Header.Set("Authorization", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Printf("Error making request: %v\n", err)
return
}
defer resp.Body.Close()
var result map[string]interface{}
if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
fmt.Printf("Error decoding response: %v\n", err)
return
}
fmt.Printf("Response: %+v\n", result)
}<?php
$url = 'https://dashboard.whatsable.app/api/whatsapp/messages/v2.0.0/send';
$data = [
'to' => '+1234567890',
'text' => 'Hello, this is a test message from WhatsAble!'
];
$options = [
'http' => [
'header' => [
'Authorization: YOUR_API_KEY',
'Content-Type: application/json'
],
'method' => 'POST',
'content' => json_encode($data)
]
];
$context = stream_context_create($options);
try {
$result = file_get_contents($url, false, $context);
$response = json_decode($result, true);
print_r($response);
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}require 'net/http'
require 'json'
require 'uri'
url = URI('https://dashboard.whatsable.app/api/whatsapp/messages/v2.0.0/send')
data = {
to: '+1234567890',
text: 'Hello, this is a test message from WhatsAble!'
}
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request['Authorization'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = data.to_json
begin
response = http.request(request)
puts JSON.parse(response.body)
rescue => e
puts "Error: #{e.message}"
endimport java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import org.json.JSONObject;
public class WhatsAbleClient {
public static void main(String[] args) {
try {
HttpClient client = HttpClient.newHttpClient();
JSONObject data = new JSONObject();
data.put("to", "+1234567890");
data.put("text", "Hello, this is a test message from WhatsAble!");
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://dashboard.whatsable.app/api/whatsapp/messages/v2.0.0/send"))
.header("Authorization", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(data.toString()))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
} catch (Exception e) {
System.out.println("Error: " + e.getMessage());
}
}
}{
"success": true,
"message": "<string>",
"details": {
"messages": [
{
"id": "<string>",
"message_status": "<string>"
}
]
}
}{
"success": false,
"message": "<string>",
"details": "<string>"
}{
"success": false,
"message": "<string>",
"details": "<string>"
}{
"success": false,
"message": "<string>",
"details": "<string>"
}{
"success": false,
"message": "<string>",
"details": "<string>"
}Authorizations
Your WhatsAble API Key
Body
application/json
Was this page helpful?
⌘I