API > Webhooks - Eliminar Webhook

Webhooks - Eliminar webhook

DEL  https://{entorno}.ticketbaiws.eus/webhooks/{codigo_webhook}/

Elimina un webhook a partir de su codigo (lo devuelven POST y GET webhooks). Acepta los métodos DELETE y DEL.

Disponible en pruebas y en producción. Usa el mismo entorno en el que se creó el webhook (api-test o api).

PARÁMETROS

Sin parámetros: el código del webhook va en la URL.

DEL https://{entorno}.ticketbaiws.eus/webhooks/{codigo_webhook}/
$ curl --request DELETE \
     --url https://api-test.ticketbaiws.eus/webhooks/6904a3501884e/ \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'Token: xxx' \
     --header 'Nif: 00000014Z'
$ composer require ticketbaiws/ticketbaiws-php
<?php
// Instalación: composer require ticketbaiws/ticketbaiws-php
require 'vendor/autoload.php';

$tbai = new \TicketbaiWS\Client('xxx', '00000014Z', ['entorno' => 'test']);

// Requiere ticketbaiws-php 1.3.0 o superior
$r = $tbai->eliminarWebhook('6904a3501884e');

if ($r->isError()) {
    echo $r->getMessageText();
} else {
    print_r($r->getData());
}
$ python -m pip install requests
import requests

url = "https://api-test.ticketbaiws.eus/webhooks/6904a3501884e/"

headers = {"Accept": "application/json", "Token" : "xxx", "Nif" : "00000014Z"}
response = requests.request("DELETE", url, headers=headers)

print(response.text)
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-test.ticketbaiws.eus/webhooks/6904a3501884e/");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept: application/json");
headers = curl_slist_append(headers, "Content-Type: application/json");
headers = curl_slist_append(headers, "Token: xxx");
headers = curl_slist_append(headers, "Nif: 00000014Z");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-test.ticketbaiws.eus/webhooks/6904a3501884e/")
  .delete()
  .addHeader("Accept", "application/json")
  .addHeader("Token", "xxx")
  .addHeader("Nif", "00000014Z")
  .build();

Response response = client.newCall(request).execute();
{ } Response JSON
HTTP/1.1 200 OK
{
    "result": "OK",
    "return": [],
    "msg": "Webhook deleted successfully"
}
{ } Response (no encontrado) JSON
HTTP/1.1 200 OK
{
    "result": "ERROR",
    "return": null,
    "msg": "WEBHOOK Not Found"
}

Métodos TicketBAI / Verifactu

Documento representación

Métodos específicos para BATUZ BIZKAIA

SII (AEAT)

Clientes y productos (herramienta de facturación)

Otros métodos