Récupérer un webhook
Get /settings/webhooks/{id}
Paramètres dans l'URL :
| Nom | Description | Type | Obligatoire |
|---|---|---|---|
| id | Id du webhook | String | Oui |
Réponse :
Noeud de webhook avec les informations :
| Nom | Description | Type |
|---|---|---|
| id | Id du webhook | String |
| url | Url du webhook | String |
| description | Description du webhook | String |
| events | Evénements utilisés par le webhook | Array of String |
| success | Nombre d'appels en succès | Int |
| errors | Nombre d'appels en erreur | Int |
| createdAt | Date de création | String |
| updatedAt | Date de mise à jour | String |
Langage de programmation :
Exemple de réponse :
{
"id": "561d21979932836f57bbb894",
"url": "http://www.example.com/1444749717",
"description": "Webhook description",
"createdAt": "1444749719",
"updatedAt": "1444749719",
"success": 10,
"errors": 0,
"events": [
"clicked",
"complaint",
"delivered",
"error",
"hardbounced",
"opened",
"rejected",
"softbounced",
"unsubscribed"
]
}
Exemple de code :
curl -X GET -H "Content-Type: application/json" -H "X-Tipimail-ApiUser:YOUR_SMTP_USERNAME" -H "X-Tipimail-ApiKey:YOUR_SMTP_KEY" https://api.tipimail.com/v1/settings/webhooks/55eff0c70cf2d2153ff9733c
require 'vendor/autoload.php';
$tipimail = new Tipimail\Tipimail('YOUR_SMTP_USERNAME', 'YOUR_API_KEY');
try {
$result = $tipimail->getSettingsService()->getWebhooksService()->get('646r54g6r4gr6g46g46546d4');
var_dump($result);
}
catch(Tipimail\Exceptions\TipimailException $e) {
echo 'Exception received :', $e->getMessage(), "\n";
}