Update a webhook

Put /settings/webhooks/{id}

Parameters:

Name Description Type Mandatory
url Url used to call as event will occur String Yes
description Webhook description String Yes
events Lists of events
Event available:
  • all
or
  • delivered
  • rejected
  • error
  • bounced
  • opened
  • clicked
  • unsubscribed
  • complaint
Array Yes

Response:

Name Description Type
status success / failure String
Programming language:

Request exemple:

							{
								"url": "http://yourwebsite.com/webhook",
								"description": "my first webhook",
								"events": ["delivered", "opened", "clicked"]
							}
							

Response exemple:

							{
								"status": "success"
							}
							

Code example:

								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";
	
}