Webhook Ping Post & Ping Bidding

Please note that your Contract and Workflow need to be set up for either "Ping Post" or "Ping Bidding".

1. Ping your contracts

Among other methods, Xzazu offers you the ability to notify your contracts of a new Ping, by sending them a Webhook request. 
You can configure Webhook Pings by going into the Account Contract and adding the Delivery Method "Webhook (Push)" in the Delivery tab.
Don't forget to enable "Ping Post" or "Ping Bidding" for the new Delivery method.

When a new Ping is created for the Contract, Xzazu will send an HTTP POST request to the URL specified in the Delivery Method containing the following information:

For Ping Post

{
   "PingId":"202001P1234567",
   "Id":1234567,
   "CLPartKey":2020,
   "LeadScore":512,
   "Categories":[
      "Category 1",
      "Category 2"
   ],
   "VerticalId":1,
   "Vertical":"Vertical Name",
   "CurrencyCode":"USD",
   //culture for Amounts and Dates
   "Culture":"en-US",
   "ContractId":1,
   "Contract":"Contract Name",
   // true if this is a Test Ping
   "Test":false,
   "Date":"2020-01-01T00:00:00Z",
   "Fields":{
      "Ping Field 1":"Field Value",
      "Ping Field 2":"Field Value"
   },
   //true if the Ping Mode ByNow is enabled in the Workflow
   "BuyNow":false,
   // Lead Price in the smallest Currency Units
   "Price":100,
   "PingType":"PingPost",
   "AvailableTill":"2020-01-01T00:10:00Z",
   //true if Auto Accept is enabled in the Contract.
   "CurrentAnswer":false,
   "AccountId":1,
   "Account":"Account Name"
}

For Ping Bidding

{
   "PingId":"202001P1234567",
   "Id":1234567,
   "CLPartKey":2020,
   "LeadScore":512,
   "Categories":[
      "Category 1",
      "Category 2"
   ],
   "VerticalId":1,
   "Vertical":"Vertical Name",
   "CurrencyCode":"USD",
   //culture for Amounts and Dates
   "Culture":"en-US",
   "ContractId":1,
   "Contract":"Contract Name",
   "Test":false,
   "Date":"2020-01-01T00:00:00Z",
   "Fields":{
      "Ping Field 1":"Field Value",
      "Ping Field 2":"Field Value"
   },
   // set if there are bids present in the Xzazu from the Contract for this Lead, othewise NULL
   "CurrentBids":[
      {
         "Amount":100,
         "ShareCount":0,
         "Won":false,
         // false is the bid is invalid for this lead. (To Low etc)
         "Valid":true,
         "FundingWarning":false
      }
   ],
   // the minimum valid bid for this Lead.
   "MinBid":1000,
   // true if ShareCountBidding is enabled for the Workflow
   "ShareCountBidding":false,
   "PingType":"PingTreeBidding",
   "AvailableTill":"2020-01-01T00:10:00Z",
   // set if ShareCountBidding is enabled for this Workflow, else NULL
   "MinShareCount":1,
   "AccountId":1,
   "Account":"Account Name"
}

2. Contracts Respond to the Ping

Xzazu offers multiple methods of responding to a Ping including API calls etc. In this article, we will cover responding to a Ping by returning a JSON Pong to the HTTP Requests described above.

When an Xzazu Ping Webhook comes into the system of the Contract, the system can return a Pong (Ping answer) to Xzazu by providing a JSON response to the webhook call with status code 200.

For Ping Post

{
   "PingId":1234567,
   "CLPartKey":2020,
   // can be "Accepted" or "Rejected"
   "Type":"Accepted",
   // can be any json object, will be posted with the Lead on Webhook Delivery.
   "CustomData":{}
}

For Ping Bidding

{
   "PingId":1234567,
   "CLPartKey":2020,
   // can be "Bids" or "Rejected"
   "Type":"Bids",
   "Bids":[
      {
         // amount in the lowest unit of the Currency
         "Amount":100,
         // ignored when ShareCountBidding is disabled for the Workflow
         "ShareCount":1
      }
   ],
   // can be any json object, will be posted with the Lead on Webhook Delivery.
   "CustomData":{}
}

 

Other Articles