webhookCreate
public static string webhookCreate(string token, array webhookDetails)
Create a new Webhook based on the details provided. Return the ID of the newly created Webhook.
Section
Webhook Related Methods

Parameters
string tokenA valid token for your account. To generate a token, use the login method.
array webhookDetailsThe array containing the webhook details.
string contact_list_idThe contact list ID to whom this webhook is to be add. You can get the contact lists from listGet
string subscribesUse TRUE/FALSE or YES/NO or 1/0 value for "Subscribe" type of updates
string unsubscribesUse TRUE/FALSE or YES/NO or 1/0 value for "Unsubscribe" type of updates
string profile_updatesUse TRUE/FALSE or YES/NO or 1/0 value for "Profile Updates" type of updates
string cleaned_addressUse TRUE/FALSE or YES/NO or 1/0 value for "Cleaned Address" type of updates
string email_changedUse TRUE/FALSE or YES/NO or 1/0 value for "Email Changed" type of updates

Returns
stringReturns the Webhook ID of the newly created Webhook.


Examples
download example code
xmlrpc_webhookCreate.php


  1. <?php
  2. /**
  3. This Example shows how to authenticate a user using XML-RPC.
  4. Note that we are using the PEAR XML-RPC client and recommend others do as well.
  5. **/
  6. require_once 'XML/RPC2/Client.php';
  7. require_once 'inc/config.php';
  8. $client = XML_RPC2_Client::create($apiURL);
  9. $token = $client->login($apiLogin, $apiPassword);
  10.  
  11. /**
  12. Fetch the latest contact list ID, so we can retrieve the target contact list ID.
  13. **/
  14. $contactList = $client->listGet($token, "", 1, 1, "", "");
  15. $listID = $contactList[0]['id'];
  16.  
  17. $webhookDetails['contact_list_id'] = $listID;
  18. $webhookDetails['subscribes'] = 'TRUE or FALSE';
  19. $webhookDetails['unsubscribes'] = 'TRUE or FALSE';
  20. $webhookDetails['profile_updates'] = 'TRUE or FALSE';
  21. $webhookDetails['email_changed'] = 'TRUE or FALSE';
  22. $webhookDetails['cleaned_address'] = 'TRUE or FALSE';
  23. $webhookDetails['url'] = 'Webhook URL';
  24. $newWebhookID = $client->webhookCreate($token, $webhookDetails);
  25. ?>