Vai al contenuto

Ottieni webhook GET ​

Recupera i dettagli di un webhook specifico tramite il suo identificatore univoco.

Endpoint ​

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

Autenticazione ​

Obbligatoria

Includi una di queste intestazioni nella tua richiesta:

  • Token: <your-api-key> — Ottienila da Chiavi API
  • Authorization: Bearer <jwt-token> — Da Accedi

Richiesta ​

Parametri di percorso ​

ParametroTipoObbligatorioDescrizione
tidstring✅Identificatore univoco del webhook

Intestazioni ​

IntestazioneObbligatoriaDescrizione
Token✅La tua chiave API
Authorization✅Bearer <jwt-token>

Esempio di richiesta ​

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();

Risposta ​

Risposta di successo ​

200 OK

Restituisce l'oggetto webhook

CampoTipoDescrizione
tidstringIdentificatore univoco del webhook
namestringNome del webhook
urlstringSlug dell'URL del webhook
messagestringModello del messaggio
is_activebooleanIndica se il webhook è attivo
created_atstringData e ora di creazione
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"
}

Risposte di errore ​

StatoDescrizione
401Non autorizzato — Token non valido o mancante
404Non trovato — Il webhook non esiste

Documentazione di Pocket Alert