Saltar al contenido

Obtener webhook GET ​

Obtén los detalles de un webhook específico mediante su identificador único.

Endpoint ​

GET https://api.pocketalert.app/v1/webhooks/{tid}

Autenticación ​

Obligatorio

Incluye uno de estos encabezados en tu solicitud:

Solicitud ​

Parámetros de ruta ​

ParámetroTipoObligatorioDescripción
tidstring✅Identificador único del webhook

Encabezados ​

EncabezadoObligatorioDescripción
Token✅Tu clave de API
Authorization✅Bearer <jwt-token>

Ejemplo de solicitud ​

bash
curl -X GET "https://api.pocketalert.app/v1/webhooks/kblf7mh9j8jjyeh4fx" \
  -H "Token: your-api-key"
javascript
const tid = 'kblf7mh9j8jjyeh4fx';
const response = await fetch(`https://api.pocketalert.app/v1/webhooks/${tid}`, {
  headers: { 'Token': 'your-api-key' }
});
const webhook = await response.json();
python
import requests

tid = 'kblf7mh9j8jjyeh4fx'
response = requests.get(
    f'https://api.pocketalert.app/v1/webhooks/{tid}',
    headers={'Token': 'your-api-key'}
)
print(response.json())
php
$tid = 'kblf7mh9j8jjyeh4fx';
$response = Http::withHeaders([
    'Token' => 'your-api-key',
])->get('https://api.pocketalert.app/v1/webhooks/'.$tid);

return $response->json();

Respuesta ​

Respuesta exitosa ​

200 OK

Devuelve el objeto del webhook

CampoTipoDescripción
tidstringIdentificador único del webhook
namestringNombre del webhook
urlstringSlug de la URL del webhook
messagestringPlantilla del mensaje
is_activebooleanIndica si el webhook está activo
created_atstringFecha y hora de creación
json
{
  "tid": "kblf7mh9j8jjyeh4fx",
  "name": "GitHub Push",
  "url": "cs994rqfkk8ljngt",
  "message": "Push to %repository.name%: %head_commit.message%",
  "is_active": true,
  "created_at": "01.09.2023 22:38:48"
}

Respuestas de error ​

EstadoDescripción
401No autorizado — Token inválido o ausente
404No encontrado — El webhook no existe

Documentación de Pocket Alert