curl --request POST \
--url https://api.d-api.cloud/api/v1/hooks/va/{token} \
--header 'Content-Type: application/json' \
--data '
{
"phone": "5511999990000",
"sessionId": "<string>",
"variables": {}
}
'import requests
url = "https://api.d-api.cloud/api/v1/hooks/va/{token}"
payload = {
"phone": "5511999990000",
"sessionId": "<string>",
"variables": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({phone: '5511999990000', sessionId: '<string>', variables: {}})
};
fetch('https://api.d-api.cloud/api/v1/hooks/va/{token}', 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://api.d-api.cloud/api/v1/hooks/va/{token}",
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([
'phone' => '5511999990000',
'sessionId' => '<string>',
'variables' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.d-api.cloud/api/v1/hooks/va/{token}"
payload := strings.NewReader("{\n \"phone\": \"5511999990000\",\n \"sessionId\": \"<string>\",\n \"variables\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.d-api.cloud/api/v1/hooks/va/{token}")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"5511999990000\",\n \"sessionId\": \"<string>\",\n \"variables\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.d-api.cloud/api/v1/hooks/va/{token}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone\": \"5511999990000\",\n \"sessionId\": \"<string>\",\n \"variables\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"callId": "<string>",
"status": "queued",
"queuePosition": 123
}{
"success": true,
"code": "<string>",
"message": "<string>"
}{
"success": true,
"code": "<string>",
"message": "<string>"
}{
"success": true,
"code": "<string>",
"message": "<string>"
}{
"success": true,
"code": "<string>",
"message": "<string>"
}{
"success": true,
"code": "<string>",
"message": "<string>"
}{
"success": true,
"code": "<string>",
"message": "<string>"
}{
"success": true,
"code": "<string>",
"message": "<string>"
}{
"success": true,
"code": "<string>",
"message": "<string>"
}{
"success": true,
"code": "<string>",
"message": "<string>"
}Disparar chamada do agente (URL pública do gatilho)
Público por design: o token da URL é a credencial (sem API key). Crie o gatilho no painel.
Corpo JSON (até 16 KB): phone (com DDI; número BR sem DDI recebe 55), sessionId opcional (padrão do gatilho), variables opcional (só as variáveis declaradas no agente; até 30, valores até 500 caracteres). Também aceita chaves planas "variables.<nome>": valor no topo (o objeto variables prevalece em conflito).
Assinatura (quando o gatilho exige): X-DAPI-Signature: t=<unix>,v1=<hex HMAC-SHA256(segredo, t + "." + corpo)>, tolerância de 300 s.
Idempotency-Key (até 128): repetições em 24 h recebem a mesma resposta. Sem ela, o mesmo telefone + variáveis em 60 s também.
Fora da janela de horário do gatilho a chamada é agendada para a próxima abertura (status: "scheduled").
Erros: 404 not_found, 423 trigger_paused, 401 invalid_signature, 400 invalid_input/missing_variables, 403 session_not_allowed/country_not_allowed, 409 agent_not_published/request_in_progress, 402 insufficient_balance/daily_cap_reached, 413 payload_too_large, 429 rate_limited (com retryAfterSec e Retry-After)/queue_full.
curl --request POST \
--url https://api.d-api.cloud/api/v1/hooks/va/{token} \
--header 'Content-Type: application/json' \
--data '
{
"phone": "5511999990000",
"sessionId": "<string>",
"variables": {}
}
'import requests
url = "https://api.d-api.cloud/api/v1/hooks/va/{token}"
payload = {
"phone": "5511999990000",
"sessionId": "<string>",
"variables": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({phone: '5511999990000', sessionId: '<string>', variables: {}})
};
fetch('https://api.d-api.cloud/api/v1/hooks/va/{token}', 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://api.d-api.cloud/api/v1/hooks/va/{token}",
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([
'phone' => '5511999990000',
'sessionId' => '<string>',
'variables' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.d-api.cloud/api/v1/hooks/va/{token}"
payload := strings.NewReader("{\n \"phone\": \"5511999990000\",\n \"sessionId\": \"<string>\",\n \"variables\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.d-api.cloud/api/v1/hooks/va/{token}")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"5511999990000\",\n \"sessionId\": \"<string>\",\n \"variables\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.d-api.cloud/api/v1/hooks/va/{token}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone\": \"5511999990000\",\n \"sessionId\": \"<string>\",\n \"variables\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"callId": "<string>",
"status": "queued",
"queuePosition": 123
}{
"success": true,
"code": "<string>",
"message": "<string>"
}{
"success": true,
"code": "<string>",
"message": "<string>"
}{
"success": true,
"code": "<string>",
"message": "<string>"
}{
"success": true,
"code": "<string>",
"message": "<string>"
}{
"success": true,
"code": "<string>",
"message": "<string>"
}{
"success": true,
"code": "<string>",
"message": "<string>"
}{
"success": true,
"code": "<string>",
"message": "<string>"
}{
"success": true,
"code": "<string>",
"message": "<string>"
}{
"success": true,
"code": "<string>",
"message": "<string>"
}