Use Webhooks to be notified about events that happen in your direct mail campaigns. You are able to set up different endpoints for each campaign. Once Webhooks are being processed, you can view activity under the ‘Logs’ menu item.

Setting up Webhooks for Campaigns

Select ‘Webhooks’ from the drop down menu under your Postalytics Username

Click on the Pen and Pad edit icon for the campaign that you want to receive webhook notifications on.

Click enabled under ‘Enable Webhook’ and key in your endpoint URL. This endpoint URL is the receiving application that will consume the webhook we send to you. Click on Update when you are done.


Sample Webhook JSON

Below is a sample webhook you will see being sent from us. Almost all of this structure is sent every time regardless of whether it has data in it or not. The one element that will fluctuate is the meta.fields element. If you have variable data in your lists, it will be sent here. If you don’t, it will be suppressed. 

Sample Webhook JSON Webhook Notifications Tracking

Webhook Sections

The data received in a webhook is broken into four sections which are defined below:

Basic Information

mailId –  Internal use and can be ignored

eventDate: – The timestamp of the event 

expectedDeliveryDate – After some events, an estimated delivery timestamp will be filled in here

eventType – An integer that defines the time of event. Below are the events and the associated eventType ids:

  • 0 – Created

  • 9 – Addressed

  • 10 – Printed

  • 11 – Mailed

  • 4 – In Transit

  • 5 – In Local Area

  • 6-  Processed for Delivery

  • 2 – Re-Routed

  • 3 – Return to Sender

  • 7 – pURL Opened

  • 8 – pURL Completed

status –  The HTTP response code, Mostly used internally

statusDescription – The HTTP response description. Mostly used internally

retryAttempts  – If there was an issue, how many retries were attempted

To

This contains the mailpiece receiver’s information including basic, address, city , state, zip. But also some error code and update info. In the ‘addressed’ event, if an address has been corrected by CASS or NCOA, the wasUpdated flag will be set and the address info will contain the updated info.

From

This contains the mailpiece receiver’s information.

Piece

Mostly for internal use defining the piece type, size etc. that was sent.

Meta

This section contains additional info about the event. Items to mote in this section are

dataId  – This is the contactId for the recipient. It can be used to match back internal data

dropId – This is the campaign mail drop id

fields – This will contain variable data from your contact’s record. Any variable data you have mapped into a list will be re-sent back here. This is useful in sending back internal contact or campaign ids you need to re-find the contact on your side.