webhookUpdate()

Updates webhook options.

webhookUpdate(string $wid, string $name, string/array $value) : string
Input parameters
  • wid - webhook ID
  • name - name of updated option
  • value - what option will be updated to

List of possible names:

  • title - list name
  • list_id - list ID that the webhook is based on
  • url - URL where requests are delivered to (optional)
  • secret_key - secret key that is passed in every webhook request you receive. It gives you the opportunity to verify that requests originated from us (optional)
  • events - array of events used to trigger the webhook (optional). Possible values are: contact.subscribe, contact.unsubscribe, contact.update, email.change, email.bounce, email.open, email.click
  • sources - array of sources used to trigger the webhook (optional). Possible values are: subscriber, admin, api
Information obtained
  • true if request for updating webhook has succeeded

Examples

mgapi_webhookUpdate.php
<?php
/**
This Example shows how to webhookUpdate using the MGAPI.php class and do some basic error checking.
**/
require_once 'inc/MGAPI.class.php';
require_once 'inc/config.inc.php'; //contains apikey

$api = new MGAPI($apikey);

$wid = $webhookId;
$name = 'title';
$value = 'New Title';

$retval = $api->webhookUpdate($wid, $name, $value);

header("Content-Type: text/plain«);
if ($api->errorCode){
	echo «Unable to load webhookUpdate()!\n»;
	echo «\tCode={$api->errorCode}\n»;
	echo «\tMsg={$api->errorMessage}\n»;
} else {
	echo «SUCCESS! \n»;
}

© 2010-2018 Mailigen. All rights reserved.