Modifier un webhook
Put /settings/webhooks/{id}
Paramètres :
| Nom | Description | Type | Obligatoire |
|---|---|---|---|
| url | Url à appeler lors d'un événement | String | Oui |
| description | Description du webhook | String | Oui |
| events |
Liste des événements
Evénements disponibles :
| Array | Oui |
Réponse :
| Nom | Description | Type |
|---|---|---|
| status | success / failure | String |
Langage de programmation :
Exemple de requête :
{
"url": "http://yourwebsite.com/webhook",
"description": "my first webhook",
"events": ["delivered", "opened", "clicked"]
}
Exemple de réponse :
{
"status": "success"
}
Exemple de code :
curl -X PUT -d '{"description":"Webhook description 2"}' -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 {
$tipimail->getSettingsService()->getWebhooksService()->updateUrl('646r54g6r4gr6g46g46546d4', 'http://www.example.com/example2');
$tipimail->getSettingsService()->getWebhooksService()->updateDescription('646r54g6r4gr6g46g46546d4', 'New description');
$tipimail->getSettingsService()->getWebhooksService()->updateEventsWithAll('646r54g6r4gr6g46g46546d4');
$events = new Tipimail\Settings\Webhooks\WebhookEvents();
$events->enableDelivered();
$events->enableHardbounced();
$tipimail->getSettingsService()->getWebhooksService()->updateEventsWithSelected('646r54g6r4gr6g46g46546d4', $events);
}
catch(Tipimail\Exceptions\TipimailException $e) {
echo 'Exception received :', $e->getMessage(), "\n";
}