curl --request PUT \
--url https://api.wabox.me/partner/webhooks \
--header 'Content-Type: application/json' \
--header 'Partner-Token: <api-key>' \
--data '
{
"single_url_enabled": true,
"single_url": "https://kinbox.example/wabox/events",
"notify_sent_by_me": true
}
'const options = {
method: 'PUT',
headers: {'Partner-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
single_url_enabled: true,
single_url: 'https://kinbox.example/wabox/events',
notify_sent_by_me: true
})
};
fetch('https://api.wabox.me/partner/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wabox.me/partner/webhooks"
payload = {
"single_url_enabled": True,
"single_url": "https://kinbox.example/wabox/events",
"notify_sent_by_me": True
}
headers = {
"Partner-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wabox.me/partner/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'single_url_enabled' => true,
'single_url' => 'https://kinbox.example/wabox/events',
'notify_sent_by_me' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Partner-Token: <api-key>"
],
]);
$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://api.wabox.me/partner/webhooks"
payload := strings.NewReader("{\n \"single_url_enabled\": true,\n \"single_url\": \"https://kinbox.example/wabox/events\",\n \"notify_sent_by_me\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Partner-Token", "<api-key>")
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))
}{
"received_url": null,
"delivery_url": null,
"message_status_url": null,
"connected_url": null,
"disconnected_url": null,
"chat_presence_url": null,
"single_url_enabled": true,
"single_url": "https://kinbox.example/wabox/events",
"notify_sent_by_me": true,
"ignore_groups": false,
"ignore_private": false,
"ignore_text": false,
"ignore_image": false,
"ignore_video": false,
"ignore_audio": false,
"ignore_document": false,
"ignore_received_callback": false,
"ignore_delivery_callback": false,
"ignore_message_status_callback": false,
"ignore_connected_callback": false,
"ignore_disconnected_callback": false,
"ignore_chat_presence_callback": true,
"secret": "whsec_4b1d9e8f7a6c5d4e3f2a1b0c9d8e7f6a",
"configured": true,
"used_by_instances": 42
}{
"error": {
"code": "partner_token_required",
"message": "Invalid Partner-Token"
}
}Mesmos campos de PUT /webhooks da instância, menos use_workspace_webhooks. Só os campos enviados mudam. No primeiro PUT o Wabox gera o secret do workspace — guarde-o para verificar X-Wabox-Signature das instâncias que herdam. Instâncias com URLs próprias (use_workspace_webhooks: false) não são afetadas.
curl --request PUT \
--url https://api.wabox.me/partner/webhooks \
--header 'Content-Type: application/json' \
--header 'Partner-Token: <api-key>' \
--data '
{
"single_url_enabled": true,
"single_url": "https://kinbox.example/wabox/events",
"notify_sent_by_me": true
}
'const options = {
method: 'PUT',
headers: {'Partner-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
single_url_enabled: true,
single_url: 'https://kinbox.example/wabox/events',
notify_sent_by_me: true
})
};
fetch('https://api.wabox.me/partner/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wabox.me/partner/webhooks"
payload = {
"single_url_enabled": True,
"single_url": "https://kinbox.example/wabox/events",
"notify_sent_by_me": True
}
headers = {
"Partner-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wabox.me/partner/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'single_url_enabled' => true,
'single_url' => 'https://kinbox.example/wabox/events',
'notify_sent_by_me' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Partner-Token: <api-key>"
],
]);
$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://api.wabox.me/partner/webhooks"
payload := strings.NewReader("{\n \"single_url_enabled\": true,\n \"single_url\": \"https://kinbox.example/wabox/events\",\n \"notify_sent_by_me\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Partner-Token", "<api-key>")
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))
}{
"received_url": null,
"delivery_url": null,
"message_status_url": null,
"connected_url": null,
"disconnected_url": null,
"chat_presence_url": null,
"single_url_enabled": true,
"single_url": "https://kinbox.example/wabox/events",
"notify_sent_by_me": true,
"ignore_groups": false,
"ignore_private": false,
"ignore_text": false,
"ignore_image": false,
"ignore_video": false,
"ignore_audio": false,
"ignore_document": false,
"ignore_received_callback": false,
"ignore_delivery_callback": false,
"ignore_message_status_callback": false,
"ignore_connected_callback": false,
"ignore_disconnected_callback": false,
"ignore_chat_presence_callback": true,
"secret": "whsec_4b1d9e8f7a6c5d4e3f2a1b0c9d8e7f6a",
"configured": true,
"used_by_instances": 42
}{
"error": {
"code": "partner_token_required",
"message": "Invalid Partner-Token"
}
}Authorizations
Credencial da Partner API (workspace › Segurança › Partner API). Só nas rotas /partner/*.
Body
true = todos os eventos vão para single_url; as *_url por tipo são ignoradas.
URL única para todos os eventos (quando single_url_enabled).
Response
Configuração após a alteração.
URL http(s) ou null (desligado).
URL http(s) ou null (desligado).
URL http(s) ou null (desligado).
URL http(s) ou null (desligado).
URL http(s) ou null (desligado).
URL http(s) ou null (desligado).
true = todos os eventos vão para single_url; as *_url por tipo são ignoradas.
URL única para todos os eventos (quando single_url_enabled).
Chave HMAC do X-Wabox-Signature para toda instância que herda esta configuração (use_workspace_webhooks). Gerada no primeiro PUT.
false até o primeiro PUT (nada a herdar ainda).
Instâncias ativas que herdam esta configuração no momento.
-9007199254740991 <= x <= 9007199254740991