Menautkan WhatsApp dengan QR Code
curl --request POST \
--url https://waberes.fredoronan.web.id/api/v1/devices/connect/qr \
--header 'X-API-Key: <x-api-key>' \
--header 'X-Device-Id: <x-device-id>' \
--header 'X-Signature: <x-signature>' \
--header 'X-Timestamp: <x-timestamp>'import requests
url = "https://waberes.fredoronan.web.id/api/v1/devices/connect/qr"
headers = {
"X-API-Key": "<x-api-key>",
"X-Timestamp": "<x-timestamp>",
"X-Signature": "<x-signature>",
"X-Device-Id": "<x-device-id>"
}
response = requests.post(url, 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>'
}
};
fetch('https://waberes.fredoronan.web.id/api/v1/devices/connect/qr', 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/devices/connect/qr",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://waberes.fredoronan.web.id/api/v1/devices/connect/qr"
req, _ := http.NewRequest("POST", url, nil)
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>")
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/devices/connect/qr")
.header("X-API-Key", "<x-api-key>")
.header("X-Timestamp", "<x-timestamp>")
.header("X-Signature", "<x-signature>")
.header("X-Device-Id", "<x-device-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://waberes.fredoronan.web.id/api/v1/devices/connect/qr")
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>'
response = http.request(request)
puts response.read_body{
"data": {
"qr_code": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...",
"qr_duration": 30
},
"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
}Devices
Menautkan WhatsApp dengan QR Code
Anda bisa menggunakan route API ini untuk menautkan akun whatsapp anda
POST
/
api
/
v1
/
devices
/
connect
/
qr
Menautkan WhatsApp dengan QR Code
curl --request POST \
--url https://waberes.fredoronan.web.id/api/v1/devices/connect/qr \
--header 'X-API-Key: <x-api-key>' \
--header 'X-Device-Id: <x-device-id>' \
--header 'X-Signature: <x-signature>' \
--header 'X-Timestamp: <x-timestamp>'import requests
url = "https://waberes.fredoronan.web.id/api/v1/devices/connect/qr"
headers = {
"X-API-Key": "<x-api-key>",
"X-Timestamp": "<x-timestamp>",
"X-Signature": "<x-signature>",
"X-Device-Id": "<x-device-id>"
}
response = requests.post(url, 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>'
}
};
fetch('https://waberes.fredoronan.web.id/api/v1/devices/connect/qr', 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/devices/connect/qr",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://waberes.fredoronan.web.id/api/v1/devices/connect/qr"
req, _ := http.NewRequest("POST", url, nil)
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>")
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/devices/connect/qr")
.header("X-API-Key", "<x-api-key>")
.header("X-Timestamp", "<x-timestamp>")
.header("X-Signature", "<x-signature>")
.header("X-Device-Id", "<x-device-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://waberes.fredoronan.web.id/api/v1/devices/connect/qr")
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>'
response = http.request(request)
puts response.read_body{
"data": {
"qr_code": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...",
"qr_duration": 30
},
"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 (bisa di dapatkan melalui dashboard)
⌘I