API Ping Post & Ping Bidding
1. Ping your contracts
Among other methods, Xzazu offers you the ability to notify your contracts of a new Ping through the Xzazu API.
You can configure API Pings by going into the Account Contract and adding the Delivery Method "API (Pull)" 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's system can retrieve the ping by issuing the following request to the Xzazu API:
HTTP GET https://api.xzazu.com/v1/OutboundPing/Receive
Headers:
'api_key: YOUR API KEY' --header 'subdomain: YOUR SUBDOMAIN'
The Xzazu API will return a list of non delivered pings like so:
{ "OutboundPings":[ { "PingId":"202002P1234567", "AvailableTill":"2021-12-14T12:37:44.794Z", // can be "PingPost" or "PingBidding" "Type":"PingPost", "Test":true, "Id":1234567, "CLPartKey":202002, "LeadScore":512, "Categories":[ "Category 1", "Category 2" ], "VerticalId":1, "Vertical":"Vertical Name", "ContractId":1, "Contract":"Contract NAme", "AccountId":1, "Account":"Account Name", "CurrencyCode":"USD", "Culture":"en-US", "Fields":[ { "Name":"Ping Field 1", "Value": "Field Value" }, { "Name":"Ping Field 2", "Value": "Field Value" } ], "Date":"2021-12-14T12:37:44.794Z" } ] }
2. Contracts Respond to the Ping
Xzazu offers multiple methods of responding to a Ping. In this article, we will cover responding to a Ping by posting a Pong (ping response) to the Xzazu API
To respond to a Ping the Contract can issue a request to the following Xzazu API URL
HTTP POST - https://api.xzazu.com/v1/InboundPong/Create
Headers:
'api_key: YOUR API KEY' --header 'subdomain: YOUR SUBDOMAIN'
The payload 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 Delivery. "CustomData":{} }
The payload 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 Delivery. "CustomData":{} }
The following response will be returned by the Xzazu API:
{ "CLPartKey": 202002, "PingId": 1234567, // Ping Bidding oly, true if bids (may) acceed Contract Funding "FundingWarning": false, // Ping Bidding oly. Contains the bids with a funding warning. "FundingWarningBids": [ { "ShareCount": 0, // amount in the lowest unit of the Currency "Amount": 100, "Valid": true, //true if bid (may) acceed Contract Funding "FundingWarning": true } ], // contains invalid bids. Invalid bids are not evaluated during lead distribution. "InvalidBids": [ { "ShareCount": 0, // amount in the lowest unit of the Currency "Amount": 100, //true if bid (may) acceed Contract Funding "FundingWarning": true } ], // contains errors regarding the invalid bids "Error": "Invalid Bid error discription" }