Mengirim Chat Presence WhatsApp
curl --request POST \
--url https://waberes.fredoronan.web.id/api/v1/messages/chat-presence \
--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 '
{
"action": "start",
"phone_destination": "6281234567890"
}
'import requests
url = "https://waberes.fredoronan.web.id/api/v1/messages/chat-presence"
payload = {
"action": "start",
"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({action: 'start', phone_destination: '6281234567890'})
};
fetch('https://waberes.fredoronan.web.id/api/v1/messages/chat-presence', 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/chat-presence",
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([
'action' => 'start',
'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/chat-presence"
payload := strings.NewReader("{\n \"action\": \"start\",\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/chat-presence")
.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 \"action\": \"start\",\n \"phone_destination\": \"6281234567890\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://waberes.fredoronan.web.id/api/v1/messages/chat-presence")
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 \"action\": \"start\",\n \"phone_destination\": \"6281234567890\"\n}"
response = http.request(request)
puts response.read_body{
"data": {},
"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 Chat Presence WhatsApp
Anda bisa menggunakan route API ini untuk mengirim tanda typing atau mengetik dan juga menyetopnya
POST
/
api
/
v1
/
messages
/
chat-presence
Mengirim Chat Presence WhatsApp
curl --request POST \
--url https://waberes.fredoronan.web.id/api/v1/messages/chat-presence \
--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 '
{
"action": "start",
"phone_destination": "6281234567890"
}
'import requests
url = "https://waberes.fredoronan.web.id/api/v1/messages/chat-presence"
payload = {
"action": "start",
"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({action: 'start', phone_destination: '6281234567890'})
};
fetch('https://waberes.fredoronan.web.id/api/v1/messages/chat-presence', 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/chat-presence",
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([
'action' => 'start',
'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/chat-presence"
payload := strings.NewReader("{\n \"action\": \"start\",\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/chat-presence")
.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 \"action\": \"start\",\n \"phone_destination\": \"6281234567890\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://waberes.fredoronan.web.id/api/v1/messages/chat-presence")
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 \"action\": \"start\",\n \"phone_destination\": \"6281234567890\"\n}"
response = http.request(request)
puts response.read_body{
"data": {},
"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 chat presence yang ingin di kirimkan. Properti action hanya boleh di isi dengan 'start' untuk memulai sinyal typing atau 'stop' untuk menghentikannya
⌘I