Mengirim Pesan WhatsApp
curl --request POST \
--url https://waberes.fredoronan.web.id/api/v1/messages/send \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--header 'X-Device-Id: <x-device-id>' \
--header 'X-Signature: <x-signature>' \
--header 'X-Timestamp: <x-timestamp>' \
--data '
{
"message": "Test Send Message from API",
"phone_destination": "6281234567890"
}
'import requests
url = "https://waberes.fredoronan.web.id/api/v1/messages/send"
payload = {
"message": "Test Send Message from API",
"phone_destination": "6281234567890"
}
headers = {
"X-API-Key": "<x-api-key>",
"X-Timestamp": "<x-timestamp>",
"X-Signature": "<x-signature>",
"X-Device-Id": "<x-device-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-Key': '<x-api-key>',
'X-Timestamp': '<x-timestamp>',
'X-Signature': '<x-signature>',
'X-Device-Id': '<x-device-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({message: 'Test Send Message from API', phone_destination: '6281234567890'})
};
fetch('https://waberes.fredoronan.web.id/api/v1/messages/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://waberes.fredoronan.web.id/api/v1/messages/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => 'Test Send Message from API',
'phone_destination' => '6281234567890'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <x-api-key>",
"X-Device-Id: <x-device-id>",
"X-Signature: <x-signature>",
"X-Timestamp: <x-timestamp>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://waberes.fredoronan.web.id/api/v1/messages/send"
payload := strings.NewReader("{\n \"message\": \"Test Send Message from API\",\n \"phone_destination\": \"6281234567890\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<x-api-key>")
req.Header.Add("X-Timestamp", "<x-timestamp>")
req.Header.Add("X-Signature", "<x-signature>")
req.Header.Add("X-Device-Id", "<x-device-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://waberes.fredoronan.web.id/api/v1/messages/send")
.header("X-API-Key", "<x-api-key>")
.header("X-Timestamp", "<x-timestamp>")
.header("X-Signature", "<x-signature>")
.header("X-Device-Id", "<x-device-id>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Test Send Message from API\",\n \"phone_destination\": \"6281234567890\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://waberes.fredoronan.web.id/api/v1/messages/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<x-api-key>'
request["X-Timestamp"] = '<x-timestamp>'
request["X-Signature"] = '<x-signature>'
request["X-Device-Id"] = '<x-device-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"Test Send Message from API\",\n \"phone_destination\": \"6281234567890\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"job_id": "abcde12345"
},
"message": "berhasil melakukan sesuatu",
"success": true
}{
"code": "error code (sebatas kode error saja)",
"error": "verbosed error message (keterangan error yang lebih detail)",
"success": false
}{
"code": "error code (sebatas kode error saja)",
"error": "verbosed error message (keterangan error yang lebih detail)",
"success": false
}{
"code": "error code (sebatas kode error saja)",
"error": "verbosed error message (keterangan error yang lebih detail)",
"success": false
}{
"code": "error code (sebatas kode error saja)",
"error": "verbosed error message (keterangan error yang lebih detail)",
"success": false
}Messages
Mengirim Pesan WhatsApp
Anda bisa menggunakan route API ini untuk mengirim pesan whatsapp programmatically atau secara terprogram menggunakan API. Anda bisa memanfaatkannya untuk integrasi otomasi sistem anda. Contohnya seperti sistem OTP, WA Broadcast, Bot dan masih banyak lagi
POST
/
api
/
v1
/
messages
/
send
Mengirim Pesan WhatsApp
curl --request POST \
--url https://waberes.fredoronan.web.id/api/v1/messages/send \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--header 'X-Device-Id: <x-device-id>' \
--header 'X-Signature: <x-signature>' \
--header 'X-Timestamp: <x-timestamp>' \
--data '
{
"message": "Test Send Message from API",
"phone_destination": "6281234567890"
}
'import requests
url = "https://waberes.fredoronan.web.id/api/v1/messages/send"
payload = {
"message": "Test Send Message from API",
"phone_destination": "6281234567890"
}
headers = {
"X-API-Key": "<x-api-key>",
"X-Timestamp": "<x-timestamp>",
"X-Signature": "<x-signature>",
"X-Device-Id": "<x-device-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-Key': '<x-api-key>',
'X-Timestamp': '<x-timestamp>',
'X-Signature': '<x-signature>',
'X-Device-Id': '<x-device-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({message: 'Test Send Message from API', phone_destination: '6281234567890'})
};
fetch('https://waberes.fredoronan.web.id/api/v1/messages/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://waberes.fredoronan.web.id/api/v1/messages/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => 'Test Send Message from API',
'phone_destination' => '6281234567890'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <x-api-key>",
"X-Device-Id: <x-device-id>",
"X-Signature: <x-signature>",
"X-Timestamp: <x-timestamp>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://waberes.fredoronan.web.id/api/v1/messages/send"
payload := strings.NewReader("{\n \"message\": \"Test Send Message from API\",\n \"phone_destination\": \"6281234567890\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<x-api-key>")
req.Header.Add("X-Timestamp", "<x-timestamp>")
req.Header.Add("X-Signature", "<x-signature>")
req.Header.Add("X-Device-Id", "<x-device-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://waberes.fredoronan.web.id/api/v1/messages/send")
.header("X-API-Key", "<x-api-key>")
.header("X-Timestamp", "<x-timestamp>")
.header("X-Signature", "<x-signature>")
.header("X-Device-Id", "<x-device-id>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Test Send Message from API\",\n \"phone_destination\": \"6281234567890\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://waberes.fredoronan.web.id/api/v1/messages/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<x-api-key>'
request["X-Timestamp"] = '<x-timestamp>'
request["X-Signature"] = '<x-signature>'
request["X-Device-Id"] = '<x-device-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"Test Send Message from API\",\n \"phone_destination\": \"6281234567890\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"job_id": "abcde12345"
},
"message": "berhasil melakukan sesuatu",
"success": true
}{
"code": "error code (sebatas kode error saja)",
"error": "verbosed error message (keterangan error yang lebih detail)",
"success": false
}{
"code": "error code (sebatas kode error saja)",
"error": "verbosed error message (keterangan error yang lebih detail)",
"success": false
}{
"code": "error code (sebatas kode error saja)",
"error": "verbosed error message (keterangan error yang lebih detail)",
"success": false
}{
"code": "error code (sebatas kode error saja)",
"error": "verbosed error message (keterangan error yang lebih detail)",
"success": false
}Header
API Key anda
Timestamp generate otomatis secara terprogram/programmatically, jangan manual
Signature(METHOD + Path + timestamp + hashed(body))
Device ID yang sudah connected
Body
application/json
Data Pesan yang ingin dikirim beserta nomor tujuan
⌘I