Blacklist / Whitelist Functionality With a Ping Post Delivery
This article goes over how you can use a Campaign / Suppression list as a Blacklist / Whitelist - which can be used with a Ping Post delivery using the REST API search call, to search through the campaign on the Ping and then perform the Post based on the result on the search call.
If we have two scenarios:
- WHITELIST - You have a campaign or suppression list that contains emails or phone numbers and you would like to trigger a delivery if the lead's email IS contained on that campaign or suppression list.
- BLACKLIST - You have a campaign or suppression list that contains emails or phone numbers and you would like to trigger a delivery if the lead's email IS NOT contained on that campaign or suppression list.
Both scenarios would be configured in the same way, the difference would be how you set up your Ping Post delivery logic for when the Post needs to be sent.
Taking the campaign/suppression list ID from the BLACKLIST/WHITELIST campaign:
As per the Search leads via REST API article - if you open the campaign or suppression list configuration, the ID is located in the URL of the configuration page.
You will need to use an admin API key that has the lead search permission enabled.
The full documentation for the search call (or any API calls) can be found on the API key page, after selecting the permission and scrolling down the page.
Setting up the "Ping Post" Delivery
On the campaign you would like to set up the Ping Post delivery on (which will be different to the whitelist/blacklist campaign):
The "Ping Request" basic search payload would look like this:
[JSON POST] https://{ACCOUNTNAME}.leadbyte.co.uk/restapi/v1.3/leads/search
{
"key": "{APIKEY}",
"searches": [
{
"campaignId": {CAMPAIGNID},
"email": "[email]"
}
]
}
Alternatively, you can use "phone" as a parameter instead of "email".
[JSON POST] https://{ACCOUNTNAME}.leadbyte.co.uk/restapi/v1.3/leads/search
{
"key": "{APIKEY}",
"searches": [
{
"campaignId": {CAMPAIGNID},
"phone": "[phone1]"
}
]
}
Setting up the "Ping Request" Post send logic for a WHITELIST
Underneath the Ping Request payload you would want to set your Response type to "JSON"
Success key should be "totalMatches"
Condition "is greater than or equal to"
Value "1"
Send Post IF:
Set the dropdown to "Ping Response"
Key to "totalMatches"
Condition "is greater than or equal to"
Value "1"
Setting up the "Ping Request" Post send logic for a BLACKLIST
Underneath the Ping Request payload you would want to set your Response type to "JSON"
Success key should be "totalMatches"
Condition "is"
Value "0"
Send Post IF:
Set the dropdown to "Ping Response"
Key to "totalMatches"
Condition "is"
Value "0"
Setting up the "Post Request"
Your post request can now be configured however you need it to be, this is where the lead will be sent to if the ping conditions are met.
You can set this up in the same way you would a regular direct post delivery - posting out to a buyer's system, or posting into another LeadByte campaign as you would with a LeadByte integration guide.
If your buyer's system requires a 2 step delivery, you would need to post into another campaign with a 2 step delivery created in it, as this Ping Post flow only allows for a 1 step call for the Post.
For example:
Here is a payload for posting into a different LeadByte campaign (using an admin or supplier API Key with the lead create permission enabled).
[JSON POST] https://{ACCOUNTNAME}.leadbyte.co.uk/restapi/v1.3/leads
{
"campid": "RECEIVING-CAMPAIGN",
"email": "[email]",
"firstname": "[firstname]",
"lastname": "[lastname]",
"testing1": "[data1]",
"testing2": "[data2]",
"testing3": "[data3]"
}
Custom Headers
X_KEY: {APIKEY}
The success remote system response for posting into a LeadByte campaign would either be:
KEYWORD: "status":"Success"
or
KEYWORD: "code":1
FAQ
Q: If my blacklist/whitelist email/phone1 values are encrypted with MD5 or SHA256 - how can I use the search call with these encrypted values?
A: Underneath your "Ping Request" logic, in the "Payload Sample Values" section - you can click the options for the [EMAIL] or [PHONE1] tag and set the "Encryption type" to MD5 or SHA256. This will perform the search call with the value encrypted.
If you have any questions at all please get in touch with support by submitting a ticket through the system or by emailing support@leadbyte.co.uk
Comments