Skip to content

Create Webhook configuration

Request

Webhook provides the mechanism to push locker events as they occur. With help of this user would be able to receive events as they are generated and is received to the end user. This operation creates a webhook configuration. It needs details of events for which webhook tracking is required also the URL with its authorization details to which the locker events be pushed.

Security
bearerAuth
Bodyapplication/jsonrequired
namestringrequired

It indicates the desired name of the webhook
Max length = 50.

Example:"webhook1"
typestringrequired

It indicates the type of webhook. Currently it takes tracking and lockeras value. These event codes are supported for the defined type:

typesupported events
lockerreservation, cancelreservation, deposit, pickup, stalemailpickup, onhold
trackingManifest, Acceptance, InTransit, DeliveryAttempt, OutForDelivery, Delivered, Exception, ReturnToSender, ReadyForPickup, PickupMissed, PickedUp
Enum:"locker""tracking"
Example:"locker"
eventsArray of stringsrequired
Example:
[ "Manifest", "InTransit", "Delivered" ]
urlstringrequired

It indicates the customer url to which events should be sent.

Example:"https://webhook.com"
timeOutnumber

It indicates the timeout value before system waits response from the customer url, here timeout indicates in seconds.

Example:5
statusstring

It indicates the status of the webhook. By default it takes active. To mark it inactive use in-active

Example:"active"
authParamscustom (object) or basic (object) or OAuth (object)required
Example:
{ "authType": "custom", "apiKey": "JsuG7jk", "headerName": "webhook1" }
One of:
curl -i -X POST \
  https://api-sandbox.sendpro360.pitneybowes.com/webhook/api/v1/webhookConfig \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "dev_webhook1",
    "type": "locker",
    "events": [
      "reservation",
      "cancelreservation",
      "deposit"
    ],
    "url": "https://webhook.com",
    "timeOut": 5,
    "status": "active",
    "authParams": {
      "authType": "custom",
      "apiKey": "JsuG7jk",
      "headerName": "webhook1"
    }
  }'

Responses

Webhook created successfully

Bodyapplication/json
webHookConfigIDstring

It is unique id system generates for the created webhook

Example:"1Q86AvxyqmA"
namestring

name of the webhook

Example:"webhook1"
typestring

It indicates the type of webhook. Currently it takes tracking and lockeras value. These event codes are supported for the defined type:

typesupported events
lockerreservation, cancelreservation, deposit, pickup, stalemailpickup
trackingManifest, Acceptance, InTransit, DeliveryAttempt, OutForDelivery, Delivered, Exception, ReturnToSender, ReadyForPickup, PickupMissed, PickedUp
Enum:"locker""tracking"
Example:"locker"
eventsArray of strings
Example:
[ "Manifest", "InTransit", "Delivered" ]
urlstring

URL to which events be pushed to

Example:"https://webhook.com"
timeOutnumber

It shows the timeout value untill which it waits to receive response from the customer url, here timeout indicates in seconds.

Example:5
statusstring

status of the webhook

Example:"active"
authParamscustom (object) or basic (object) or OAuth (object)
Example:
{ "authType": "custom", "apiKey": "JsuG7jk", "headerName": "webhook1" }
One of:
Response
{ "webHookConfigID": "DELn75Jx7r3p", "name": "dev_webhook1", "type": "locker", "events": [ "reservation", "cancelreservation", "deposit" ], "url": "https://webhook.com", "authParams": { "authType": "custom", "apiKey": "JsuG7jk", "headerName": "webhook1" }, "timeOut": 5, "status": "active", "developerPartnerId": "xxxxxx" }