GET
https://api.instvia.com/api/v1/instances/dac3a956-4e8b-4d76-8caf-fed98dfc8b05/webhook
Obter webhook
Retorna a configuração de webhook da instância (sem o secret).
Parâmetros de path
| Nome | Exemplo |
|---|---|
instance |
dac3a956-4e8b-4d76-8caf-fed98dfc8b05 |
Request
Headers
{
"Accept": "application/json",
"Authorization": "Bearer sk_live_0123456789abcdef0123456789abcdef0123456789abcdef"
}
Exemplos de código
curl -sS -X GET "https://api.instvia.com/api/v1/instances/dac3a956-4e8b-4d76-8caf-fed98dfc8b05/webhook" \
-H "Accept: application/json" \
-H "Authorization: Bearer sk_live_0123456789abcdef0123456789abcdef0123456789abcdef"
const response = await fetch('https://api.instvia.com/api/v1/instances/dac3a956-4e8b-4d76-8caf-fed98dfc8b05/webhook', {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: 'Bearer sk_live_0123456789abcdef0123456789abcdef0123456789abcdef',
}
});
const data = await response.json();
console.log(data);
<?php
$ch = curl_init('https://api.instvia.com/api/v1/instances/dac3a956-4e8b-4d76-8caf-fed98dfc8b05/webhook');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Accept: application/json',
'Authorization: Bearer sk_live_0123456789abcdef0123456789abcdef0123456789abcdef',
],
]);
$body = curl_exec($ch);
curl_close($ch);
\$data = json_decode($body, true);
Response 200
{
"success": true,
"data": {
"id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"url": "https://erp.exemplo.com/hooks/instvia",
"events": [
"instance.connected",
"instance.disconnected",
"message.received",
"message.sent"
],
"status": "ACTIVE"
}
}
Response 404
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Webhook not found."
}
}