API: cancellaWebhook
Descrizione
Il metodo cancellaWebhook elimina logicamente un webhook registrato.
Il webhook viene disabilitato e non riceverà più notifiche.
Parametri
- webhook_id (obbligatorio): ID del webhook da cancellare.
Chiamata API
https://www.fattureweb.com/api/
Esempio di Chiamata POST
{
"action": "call",
"key": "LA_TUA_API_KEY",
"code": "abcdef",
"payload": {
"api_name": "Webhook",
"method": "cancellaWebhook",
"input": {
"webhook_id": 1
}
}
}
Esempio PHP
$url = 'https://www.fattureweb.com/api/';
$payload = array(
'api_name' => 'Webhook',
'method' => 'cancellaWebhook',
'input' => array(
'webhook_id' => 1
)
);
$data = array(
'action' => 'call',
'key' => 'LA_TUA_API_KEY',
'code' => 'abcdef',
'payload' => json_encode($payload)
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
Risposta di Successo
{
"code": "200",
"result": {
"status": "success",
"message": "Webhook cancellato correttamente",
"webhook_id": 1
}
}