Obtenir un webhook GET
Récupérez les détails d'un webhook spécifique à partir de son identifiant unique.
Point de terminaison
GET https://api.pocketalert.app/v1/webhooks/{tid}Authentification
Obligatoire
Incluez l'un de ces en-têtes dans votre requête :
Requête
Paramètres de chemin
| Paramètre | Type | Obligatoire | Description |
|---|---|---|---|
tid | string | ✅ | Identifiant unique du webhook |
En-têtes
| En-tête | Obligatoire | Description |
|---|---|---|
Token | ✅ | Votre clé API |
Authorization | ✅ | Bearer <jwt-token> |
Exemple de requête
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();Réponse
Réponse de succès
200 OK
Renvoie l'objet webhook
| Champ | Type | Description |
|---|---|---|
tid | string | Identifiant unique du webhook |
name | string | Nom du webhook |
url | string | Segment d'URL du webhook |
message | string | Modèle de message |
is_active | boolean | Indique si le webhook est actif |
created_at | string | Horodatage de création |
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"
}Réponses d'erreur
| Statut | Description |
|---|---|
401 | Non autorisé — Jeton invalide ou manquant |
404 | Introuvable — Le webhook n'existe pas |