Version 1.0 (Alpha)

LeadSquad Call Ping Post API Documentation


The LeadSquad Ping Post API provides partners with the ability to ping caller data to request information about available campaigns. If available campaigns are present, a ping ID, campaign ID and payout will be sent in the response. The partner can then decide if they wish to accept that payout and post the full dataset with the response data. When the post is received LeadSquad will respond with a campaign phone number for the partner to forward their caller to. This json-based interface accepts various attributes of a caller, validates and returns success and/or failure messages.


LeadSquad Call Ping Post API Overview


The PING portion of the API accepts contact posts with personally identifiable information omitted (first_name,last_name,phone,email) and returns a unique ping_id which represents this call. It will also provide the price at which we can pay for a connected call along with a campaign_id. The POST portion requires all of the fields submitted in the PING portion as well as the inclusion of personally identifiable information (first_name,last_name,phone,email). The POST portion will additionally require the inclusion of the ping_id and campaign_id from the PING response. All calls should be forwarded retaining the orginal caller ID.


Campaign Parameters


The following are the mandatory credentials that need to be posted, together with other attributes, for the API to return any response. Your contact at LeadSquad or Aragon Advertising can provide these credentials to you.

Name Description Value
token Your API Token Get from your account rep
aff_id Your Affiliate ID Get from your account rep

The PING

Note: There are very few *required* fields, however the more data you can provide in your PING request the more campaigns that will be available in the response, and access to higher payouts. The names of these attributes are case sensitive, copy exactly as is.


API Endpoint

Staging Endpoint:
http://api.v1.lead-squad.com/auto-insurance/ping/staging/?aff_id={affiliate ID}&token={api token}
Production Endpoint:
http://api.v1.lead-squad.com/auto-insurance/ping/?aff_id={affiliate ID}&token={api token}

JSON Body



		{
		"zip_code":"11201",
		"phone":"8625918460",
		"dob_date":"08",
		"dob_month":"11",
		"dob_year":"1983",
		"accidents":false,
		"dui_sr22":false,
		"currently_insured":true,
		"current_insurance":"Allstate",
		"number_vehicles":"2",
		"homeowner":true,
		"origin":"outbound"
		}
		
Name Required Description Format
zip_code Yes Zip code Integer [0-9] {5}
phone Yes Caller's Phone Number Integer [0-9] {10}
(Example: 5555555555)
dob_date No, but preferred Date of Birth DD
dob_month No, but preferred Month of Birth MM
dob_year No, but preferred Year of Birth YYYY
accidents No, but preferred accidents or claims within the last 3 years 'false' for no accidents or claims and 'true' for accidents or claims
dui_sr22 No, but preferred DUI or SR22 in the last 3 years 'false' for no DUI or SR22 and 'true' for DUI or SR22
currently_insured No, but preferred Currently insured 'false' for not currently insured or 'true' for currently insured
current_insurance No, but preferred Name of Current Insurer Text [a-zA-Z]+
number_vehicles Yes, needs to be atleast 1 Integer Integer [1-9]{10}
homeowner No, but preferred Caller a homeowner 0 for not a homeowner or 1 for a homeowner
origin Yes Origin of call inbound or outbound

Successful PING Response



{
    "authorization": "approved",
    "source_id": "22222",
    "product": "auto insurance",
    "ping_id": "iBOd09qA2222220190227174157w66sHDPfZrAfFNdm",
    "eligibility": "true",
    "campaigns": [
        {
	   	"campaign_id": "31949",
		"payout": 3600,
		"duration": 120
        }
    ]
}
		

Note: payout is in cents and duration is in seconds.

No Eligible Campaigns PING Response



{
    "authorization": "approved",
    "source_id": "22222",
    "product": "auto insurance",
    "ping_id": "eoJjMyb62222220190227174445w66sHDPfZrAfFNdm",
    "eligibility": "false",
    "campaigns": null
}
		

The POST

Note: Ensure that you are making your POST request within 2 minutes of receiving your PING response, anything posted after 2 minutes is invalid. The POST endpoint also requires that the data matches exactly the data sent in the PING.


API Endpoint

Staging Endpoing
http://api.v1.lead-squad.com/auto-insurance/post/staging/?aff_id={affiliate ID}&token={api token}
Production Endpoing
http://api.v1.lead-squad.com/auto-insurance/post/?aff_id={affiliate ID}&token={api token}

JSON Body


		{
		"ping_id":"{received from ping response}",
		"campaign_id":"{received from ping response}",
		"phone":"5555555555",
		"email":"tony@frostyflakes.com",
		"first_name":"tony",
		"last_name":"tiger",
		"zip_code":"11201",
		"dob_date":"08",
		"dob_month":"11",
		"dob_year":"1983",
		"accidents":false,
		"dui_sr22":false,
		"currently_insured":true,
		"current_insurance":"Allstate",
		"number_vehicles":"2",
		"homeowner":true,
		"origin":"outbound"
		}
		
Name Required Description Format
ping_id Yes Ping ID from PING response Taken from response
campaign_id Yes Campaign ID from PING response Taken from response
phone Yes phone number Integer [0-9] {10}
email No Email address Text [a-zA-Z]+
first_name No, but preferred First Name Text [a-zA-Z]+
last_name No Last Name Text [a-zA-Z]+
zip_code Yes Zip code Integer [0-9] {5}
dob_date No, but preferred Date of Birth DD
dob_month No, but preferred Month of Birth MM
dob_year No, but preferred Year of Birth YYYY
accidents No, but preferred accidents or claims within the last 3 years 'false' for no accidents or claims and 'true' for accidents or claims
dui_sr22 No, but preferred DUI or SR22 in the last 3 years 'false' for no DUI or SR22 and 'true' for DUI or SR22
currently_insured No, but preferred Currently insured 'false' for not currently insured or 'true' for currently insured
current_insurance No, but preferred Name of Current Insurer Text [a-zA-Z]+
number_vehicles No, but preferred Integer Integer [0-9]{10}
homeowner No, but preferred Caller a homeowner 0 for not a homeowner or 1 for a homeowner
origin Yes Origin of call inbound or outbound

Successful POST Response



{
    "authorization": "approved",
    "source_id": "22222",
    "product": "auto insurance",
    "ping_id": "iBOd09qA2222220190227174157w66sHDPfZrAfFNdm",
    "status": "success",
    "response": "lead accepted",
    "promo_number": "555 555 5555"
}
		

Errors


Affialite ID Not Approved Error



{
    "authorization": "failed",
    "reason": "you are not authorized to use this, please contact your leadsquad manager."
}
		

Invalid Token Response



{
    "authorization": "failed",
    "reason": "your token is invalid, please request a token from your leadsquad manager."
}
		

Expired ping_id



{
    "authorization": "approved",
    "source_id": "22222",
    "product": "auto insurance",
    "ping_id": "iBOd09qA2222220190227174157w66sHDPfZrAfFNdm",
    "status": "failed",
    "response": "expired",
    "reason": "your ping_id is valid, however it has expired, you must post the pinged lead within 2 minutes."
}
		

For support please email support@lead-squad.com