Overview

Namespaces

  • None
  • PHP

Classes

  • Mandrill
  • Mandrill_Exports
  • Mandrill_Inbound
  • Mandrill_Internal
  • Mandrill_Ips
  • Mandrill_Messages
  • Mandrill_Metadata
  • Mandrill_Rejects
  • Mandrill_Senders
  • Mandrill_Subaccounts
  • Mandrill_Tags
  • Mandrill_Templates
  • Mandrill_Urls
  • Mandrill_Users
  • Mandrill_Webhooks
  • Mandrill_Whitelists

Exceptions

  • Mandrill_Error
  • Mandrill_HttpError
  • Mandrill_Invalid_CustomDNS
  • Mandrill_Invalid_CustomDNSPending
  • Mandrill_Invalid_DeleteDefaultPool
  • Mandrill_Invalid_DeleteNonEmptyPool
  • Mandrill_Invalid_EmptyDefaultPool
  • Mandrill_Invalid_Key
  • Mandrill_Invalid_Reject
  • Mandrill_Invalid_Tag_Name
  • Mandrill_Invalid_Template
  • Mandrill_IP_ProvisionLimit
  • Mandrill_Metadata_FieldLimit
  • Mandrill_NoSendingHistory
  • Mandrill_PaymentRequired
  • Mandrill_PoorReputation
  • Mandrill_ServiceUnavailable
  • Mandrill_Unknown_Export
  • Mandrill_Unknown_InboundDomain
  • Mandrill_Unknown_InboundRoute
  • Mandrill_Unknown_IP
  • Mandrill_Unknown_Message
  • Mandrill_Unknown_MetadataField
  • Mandrill_Unknown_Pool
  • Mandrill_Unknown_Sender
  • Mandrill_Unknown_Subaccount
  • Mandrill_Unknown_Template
  • Mandrill_Unknown_TrackingDomain
  • Mandrill_Unknown_Url
  • Mandrill_Unknown_Webhook
  • Mandrill_ValidationError
  • Overview
  • Namespace
  • Class
  • Tree
  1: <?php
  2: 
  3: class Mandrill_Webhooks {
  4:     public function __construct(Mandrill $master) {
  5:         $this->master = $master;
  6:     }
  7: 
  8:     /**
  9:      * Get the list of all webhooks defined on the account
 10:      * @return array the webhooks associated with the account
 11:      *     - return[] struct the individual webhook info
 12:      *         - id integer a unique integer indentifier for the webhook
 13:      *         - url string The URL that the event data will be posted to
 14:      *         - description string a description of the webhook
 15:      *         - auth_key string the key used to requests for this webhook
 16:      *         - events array The message events that will be posted to the hook
 17:      *             - events[] string the individual message event (send, hard_bounce, soft_bounce, open, click, spam, unsub, or reject)
 18:      *         - created_at string the date and time that the webhook was created as a UTC string in YYYY-MM-DD HH:MM:SS format
 19:      *         - last_sent_at string the date and time that the webhook last successfully received events as a UTC string in YYYY-MM-DD HH:MM:SS format
 20:      *         - batches_sent integer the number of event batches that have ever been sent to this webhook
 21:      *         - events_sent integer the total number of events that have ever been sent to this webhook
 22:      *         - last_error string if we've ever gotten an error trying to post to this webhook, the last error that we've seen
 23:      */
 24:     public function getList() {
 25:         $_params = array();
 26:         return $this->master->call('webhooks/list', $_params);
 27:     }
 28: 
 29:     /**
 30:      * Add a new webhook
 31:      * @param string $url the URL to POST batches of events
 32:      * @param string $description an optional description of the webhook
 33:      * @param array $events an optional list of events that will be posted to the webhook
 34:      *     - events[] string the individual event to listen for
 35:      * @return struct the information saved about the new webhook
 36:      *     - id integer a unique integer indentifier for the webhook
 37:      *     - url string The URL that the event data will be posted to
 38:      *     - description string a description of the webhook
 39:      *     - auth_key string the key used to requests for this webhook
 40:      *     - events array The message events that will be posted to the hook
 41:      *         - events[] string the individual message event (send, hard_bounce, soft_bounce, open, click, spam, unsub, or reject)
 42:      *     - created_at string the date and time that the webhook was created as a UTC string in YYYY-MM-DD HH:MM:SS format
 43:      *     - last_sent_at string the date and time that the webhook last successfully received events as a UTC string in YYYY-MM-DD HH:MM:SS format
 44:      *     - batches_sent integer the number of event batches that have ever been sent to this webhook
 45:      *     - events_sent integer the total number of events that have ever been sent to this webhook
 46:      *     - last_error string if we've ever gotten an error trying to post to this webhook, the last error that we've seen
 47:      */
 48:     public function add($url, $description=null, $events=array()) {
 49:         $_params = array("url" => $url, "description" => $description, "events" => $events);
 50:         return $this->master->call('webhooks/add', $_params);
 51:     }
 52: 
 53:     /**
 54:      * Given the ID of an existing webhook, return the data about it
 55:      * @param integer $id the unique identifier of a webhook belonging to this account
 56:      * @return struct the information about the webhook
 57:      *     - id integer a unique integer indentifier for the webhook
 58:      *     - url string The URL that the event data will be posted to
 59:      *     - description string a description of the webhook
 60:      *     - auth_key string the key used to requests for this webhook
 61:      *     - events array The message events that will be posted to the hook
 62:      *         - events[] string the individual message event (send, hard_bounce, soft_bounce, open, click, spam, unsub, or reject)
 63:      *     - created_at string the date and time that the webhook was created as a UTC string in YYYY-MM-DD HH:MM:SS format
 64:      *     - last_sent_at string the date and time that the webhook last successfully received events as a UTC string in YYYY-MM-DD HH:MM:SS format
 65:      *     - batches_sent integer the number of event batches that have ever been sent to this webhook
 66:      *     - events_sent integer the total number of events that have ever been sent to this webhook
 67:      *     - last_error string if we've ever gotten an error trying to post to this webhook, the last error that we've seen
 68:      */
 69:     public function info($id) {
 70:         $_params = array("id" => $id);
 71:         return $this->master->call('webhooks/info', $_params);
 72:     }
 73: 
 74:     /**
 75:      * Update an existing webhook
 76:      * @param integer $id the unique identifier of a webhook belonging to this account
 77:      * @param string $url the URL to POST batches of events
 78:      * @param string $description an optional description of the webhook
 79:      * @param array $events an optional list of events that will be posted to the webhook
 80:      *     - events[] string the individual event to listen for
 81:      * @return struct the information for the updated webhook
 82:      *     - id integer a unique integer indentifier for the webhook
 83:      *     - url string The URL that the event data will be posted to
 84:      *     - description string a description of the webhook
 85:      *     - auth_key string the key used to requests for this webhook
 86:      *     - events array The message events that will be posted to the hook
 87:      *         - events[] string the individual message event (send, hard_bounce, soft_bounce, open, click, spam, unsub, or reject)
 88:      *     - created_at string the date and time that the webhook was created as a UTC string in YYYY-MM-DD HH:MM:SS format
 89:      *     - last_sent_at string the date and time that the webhook last successfully received events as a UTC string in YYYY-MM-DD HH:MM:SS format
 90:      *     - batches_sent integer the number of event batches that have ever been sent to this webhook
 91:      *     - events_sent integer the total number of events that have ever been sent to this webhook
 92:      *     - last_error string if we've ever gotten an error trying to post to this webhook, the last error that we've seen
 93:      */
 94:     public function update($id, $url, $description=null, $events=array()) {
 95:         $_params = array("id" => $id, "url" => $url, "description" => $description, "events" => $events);
 96:         return $this->master->call('webhooks/update', $_params);
 97:     }
 98: 
 99:     /**
100:      * Delete an existing webhook
101:      * @param integer $id the unique identifier of a webhook belonging to this account
102:      * @return struct the information for the deleted webhook
103:      *     - id integer a unique integer indentifier for the webhook
104:      *     - url string The URL that the event data will be posted to
105:      *     - description string a description of the webhook
106:      *     - auth_key string the key used to requests for this webhook
107:      *     - events array The message events that will be posted to the hook
108:      *         - events[] string the individual message event (send, hard_bounce, soft_bounce, open, click, spam, unsub, or reject)
109:      *     - created_at string the date and time that the webhook was created as a UTC string in YYYY-MM-DD HH:MM:SS format
110:      *     - last_sent_at string the date and time that the webhook last successfully received events as a UTC string in YYYY-MM-DD HH:MM:SS format
111:      *     - batches_sent integer the number of event batches that have ever been sent to this webhook
112:      *     - events_sent integer the total number of events that have ever been sent to this webhook
113:      *     - last_error string if we've ever gotten an error trying to post to this webhook, the last error that we've seen
114:      */
115:     public function delete($id) {
116:         $_params = array("id" => $id);
117:         return $this->master->call('webhooks/delete', $_params);
118:     }
119: 
120: }
121: 
122: 
123: 
API documentation generated by ApiGen 2.8.0