Create Webhook (webhook - CreateWebhook)

Create a Webhook.

/**
 * Webhook::CreateWebhook
 *
 *  Create a webhook
 *
 *  event   [open|click|bounce|unsubsribe|complaint, required]: event type
 *  url     [string, required]: url to catch event posts
 *  name    [string, required]: webhook identifier, unique for user
 *  enabled [bool, optional, default false]: enable the webhook immediately
 */
{
  "username": "{*user*}",
  "usertoken": "{*token*}",
  "requesttype": "Webhook",
  "requestmethod": "CreateWebhook",
  "details": {
    "event": "{*event_type*}", /* required */
    "url": "{*string*}", /* required */
    "name": "{*string*}", /* required */
    "enabled": "{*bool*}"
  }
}


JSON Request Example:



json_request element


Field NameDescription
usernameUsername used to login to Pinpointe
usertokenUnique token assigned to Pinpointe account
requesttypeWebhook
requestmethodCreateWebhook


details element


Field NameDescription
event
(required)
Event Type (Required)(open, click, bounce, unsubscribe, complaint)
url
(required)
URL that catches event posts (Required)
name
(required)
Webhook identifier that's unique for the user (Required)
enabled
(required)
Enable the webhook (TRUE, FALSE) 


Successful Response


response element


Field NameDescription
statusReturns SUCCESS when successful


Unsuccessful Response


response element


Field NameDescription
statusReturns FAILED when unsuccessful
errormessageText explaining why webhook creation failed