Life

Metadata:

You can access the metadata by going to the following URL:

https://ec.katch.com:9044/metadata

Security and Information:

The API is available to the public, please be aware of the following:

  • Only secure connections using https will be accepted.
  • If we undergo a DDoS attack the service will be shut down.
  • We store parameters as they come; we do not provide validations nor XSS verification.
  • EC Tokens generated will only return data for a period of 24 hours, after that the data is lost.

Step #1

Collect ectoken
Append {ectoken} parameter to your campaign URL.

Example: http://www.landingpage.com/?{Other_Parameters}&ectoken={ectoken}

Step #2

Call the EC API with ectoken

Once you are capturing {ectoken} in your URL, pass the token to our API.
PIILookupRequest is a REST endpoint used to retrieve the lead data.
Verb: GET

Example: Route: /enhanced/pii/{ectoken}
Name Parameter Data Type Required Description
ectoken  path  Guid  Yes  Token returned on the store service. 

Formats: 

  • JSON 
  • XML 

GET + JSON

Sample Request URL to EC API:

https://ec.katch.com:9044/enhanced/pii/{ectoken}?format=json

Request Body

{"ectoken":"ba81abdb-5dcc-4ff9-b8e2-ce7f369bb0aa"}

Sample Request Response


{
"FirstName": "John",
"LastName": "Doe",
"Email": "jdoe@katch.com",
"Address1": "2481 Rosecrans Ave",
"Address2": "Suite 400",
"City": "Los Angeles",
"State": "CA",
"ZipCode": "90404",
"Phone": "310-906-5453",
"Gender": "0",
"Birthday": "01/01/1980",
"HeightFT": "6",
"heightIN": "2",
"Weight": "184",
"MaritalStatus": "1",
"CurrentlyInsured": "1",
"DUI": "1",
"Medication": "1",
"LengthOftTerm ": "7",
"PolicyAmount": "50000",
"HealthConditions ": "9"
}

DISCLAIMER: Katch encourages partners to pass data with the following field formats, but Katch does not perform field validations.

Life Lead Parameters

Field Name Values
ZipCode For US: #####-#### or ##### (can start with 0)
FirstName Varchar(50)
LastName Varchar(50)
Address1 Varchar(100)
Address2 Varchar(100)
City Varchar(50) 
State   Valid State. Varchar(20)  
Phone Valid US Phone. 10 Digits
###-###-####
Email   Valid email. Varchar(100)   
For example: user@email.com
Gender   0 = Male  
1 = Female  
HeightFT   #  
HeightIN   #  
Weight   #  
Birthday   Date (month/day/year, 09/23/1977)  
MaritalStatus 0 = Single
1 = Married
2 = Divorced
3 = Separated
4 = Widowed
5 = Domestic Partner
6 = Other
CoverageType 0 = Burial Expense
1 = Term
2 = Whole
3 = Variable
4 = Universal
5 = Not Sure
HasHealthConditions 0 = Yes
1 = No
HealthConditions 0 = AIDS/HIV
1 = Diabetes Type 1
2 = Diabetes Type 2
3 = Liver Disease
4 = Alzheimer’s Disease
5 = Lung Disease
6 = Drug Abuse
7 = Mental Illness
8 = Cancer
9 = Heart Disease
10 = Stroke
11 = Depression
12 = Kidney Disease
13 = Supplemental Oxygen
14 = Other
15 = No
PolicyAmount #
LengthOfTerm 0 = Burial Expense
1 = 1 Year
2 = 5 Years
3 = 10 Years
4 = 15 Years
5 = 20 Years
6 = 25 Years
7 = 30 Years
8 = Whole Life
9 = Universal Life
10 = Cash Value
11 = Not Sure
HazardousLifestyle 0 = Yes
1 = No
IsMilitary 0 = Yes
1 = No
Medication 0 = Yes
1 = No
DUI 0 = Yes
1 = No
CurrentlyInsured 0 = Yes
1 = No
MaritalStatus 0 = Married
1 = Single 
TobaccoUse 0 = Yes
1 = No

Life Lead Fields

See Lead Fields and Values here.

Step #3

Setting Up Your Pages

After retrieving lead data from EC API, you can pre-populate information about the consumer.
Add .js code to every webpage of your flow.

https://api-ec-imp.katch.com/js/enhanced.demo.js

<script type="text/javascript" src="https://api-ec-imp.katch.com/js/enhanced.demo.js"></script>

The following is a sample .js code implementation.


var KT_Helper = {
populateFinished: true,
elemID: '',
prefilledElems: {},
/**
* VALIDATES THE ECTOKEN
* @param{String} key The ectoken that will be used to retrieve the leadData
* @return{Boolean} Indicates if the ectoken is valid
*/
isValidKey: function(key) {
return true; //!(!key || /^\s*$/.test(key) || key.length != 36 || !(/^[0-9A-F\-]{36}$/.test(key)) );
},

/**
* GUP = GET URL PARAMETER
* @param {String} name The name of the parameter URL parameter
* @return {String} The value of the parameter searched
*/
gup: function(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.href);
if (results == null)
return "";
else
return results[1];
},

/**
* VALIDATES IF LOCAL STORAGE IS AVAILABLE (AND ENABLED)
* @return {Boolean}indicates whether local storage can be used or not
*/
isLocalStorageAvailable: function() {
var test = 'test';
try {
localStorage.setItem(test, test);
localStorage.removeItem(test);
return true;
} catch (e) {
return false;
}
},

/**
* CAPITALIZES THE FIRST CHARACTER OF AN STRING
* @param {String} string The string to change
* @return {String} The original string with the first character capitalized
* */
capitaliseFirstLetter: function(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
},

/**
* LOADS A JAVASCRIPT FILE AND EXECUTES IT
* @param {String} file The URL of the file to load
* @param {Function} callback A function to be executed after the scripts loads
* @param {Function} errorCallback A function to be executed if an error occurs
* @return N/A
*/
include_js: function(file, callback, errorCallback, extraparam) {
var sc = document.getElementsByTagName("script"),
html_doc,
js,
done = false,
queue;

for (var x in sc) {
js = sc[x];
if (js.src != null && js.src.indexOf(file) != -1 && typeof callback === "function") {

if (js.readyState === "loaded" || js.readyState === "complete") {
// READY TO USE
if (typeof extraparam !== null && typeof extraparam !== 'undefined')
callback(extraparam);
else
callback();

return true;
} else {
// WAIT FOR IT
break;
}
}
js = null;
}
// If the script is not already loaded then load it
if (js === null) {
html_doc = document.getElementsByTagName('head')[0];
js = document.createElement('script');

js.setAttribute('type', 'text/javascript');
js.setAttribute('src', file);
try {
html_doc.appendChild(js);
} catch (ex) {
if (window.console !== undefined) {
console.log('Debug: Warning! Request for ' + file + ' failed. Reason: ' + ex);
}

if (typeof errorCallback === 'function') {
errorCallback();
return true;
}
}
}

js.onload = js.onreadystatechange = function() {
var item, i, queue;

if (!done && (!js.readyState || js.readyState === "loaded" || js.readyState === "complete")) {
done = true;
js.onload = js.onreadystatechange = null;

if (js && js.parentNode && typeof callback === "function") {
if (typeof extraparam !== null && typeof extraparam !== 'undefined')
callback(extraparam);
else
callback();
return true;
}
}
};

return false;
},

getFileNameURL: function() {
//this gets the full url
var url = document.location.href;
//this removes the anchor at the end, if there is one
url = url.substring(0, (url.indexOf("#") == -1) ? url.length : url.indexOf("#"));
//this removes the query after the file name, if there is one
url = url.substring(0, (url.indexOf("?") == -1) ? url.length : url.indexOf("?"));
//this removes everything before the last slash in the path
url = url.substring(url.lastIndexOf("/") + 1, url.length);
//this removes the file extension
url = url.substring(0, (url.indexOf(".") == -1) ? url.length : url.indexOf("."));
//return
return url
},

/**
* SELECT AN OPTION BY IT'S LABEL
* @param {select field} objThe dropdown to modify
* @return N/A
*/
selectOptByText: function(obj, text) {
if (obj != null) {
text = (text) ? text : $(obj).data('kt_value');
text = text.split(/[\s,-\/]+/);
textfound = '';
for (x = 0; x < text.length; x++) { textfound = $(obj).find('option:containsi(' + text[x] + ')').first(); if (textfound.length > 0) {
x = text.length;
}
}

if (!KT_Helper.populateFinished && textfound.length > 0) {
textfound[0].selected = true;
if (obj.disabled) obj.disabled = false;
} else {
obj.options[0].selected = true;
$(obj).change();
}
}
},

/**
* Populate Fields
* @param {String} elemID is the url in which it is located at this time this script
* @return N/A
*/
populateFields: function(kt_data) {
if (typeof kt_data !== null && typeof kt_data !== 'undefined' && kt_data !== null && typeof kt_data.ErrorMessage == 'undefined') {

if (KT_Helper.isLocalStorageAvailable()) {
kt_data_sting = JSON.stringify(kt_data);
localStorage.setItem(KT_ECTOKEN, kt_data_sting);
}
KT_Helper.populateFinished = false;
//KT_Helper.elemID = elemID;
//form = document.getElementById('inquiry');
//elemType = elemID.substr(0,1);
//elemNum = elemID.substr(1,1);

/**
* Filling fields, customized according to your site
* elemenID.indexOf is used to find in which step is located in your site
* @return N/A
*/

//==================================
//==BEGIN: Sections Prefill Fields==
//==================================

console.log("The first Name of Applicant is: " + kt_data.FirstName);
//document.getElementById('lead_form_firstname').value = kt_data.FirstName;
console.log("The Address of Applicant is: " + kt_data.Address1);
//document.getElementById('lead_form_address1').value = kt_data.Address1;

//==================================
//== END: Sections Prefill Fields ==
//==================================

KT_Helper.populateFinished = true;
KT_Helper.prefilledElems[KT_Helper.elemID] = true;
KT_Helper.elemID = '';
}
},

/**
* getCookie
* @param {String} cname, the name of the cookie to be obtained
* @return If the cookie exists, return value and if not return empty
*/
getCookie: function(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) { var c = ca[i].trim(); if (c.indexOf(name) == 0) return c.substring(name.length, c.length); } return ""; }, /** * setCookie * @param {String} cname, the name of the cookie to be defined * @param {String} cvalue, the value of the cookie to be defined * @return N/A */ setCookie: function(cname, cvalue) { var d = new Date(); d.setTime(d.getTime() + (12 * 60 * 60 * 1000)); var expires = "expires=" + d.toGMTString(); document.cookie = cname + "=" + cvalue + "; " + expires + ";path=/";; } }; var KT_ECTOKEN = KT_Helper.gup('ectoken'), KT_APIURL = '//ec.katch.com:9044/enhanced/pii/' + KT_ECTOKEN + '?format=json&callback=KT_Helper.populateFields'; JQUERY_URL = '//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'; JSON_URL = '//cdn.katch.com/p/scripts/json2.js'; if (window.addEventListener) // W3C standard { window.addEventListener('load', onLoadFunctions, false); } else if (window.attachEvent) // Microsoft { window.attachEvent('onload', onLoadFunctions); } function onLoadFunctions() { if (!KT_ECTOKEN == false) { if (KT_Helper.isLocalStorageAvailable()) { localStorage.setItem('KT_ECTOKEN', KT_ECTOKEN); } KT_Helper.setCookie('KT_ECTOKEN', KT_ECTOKEN); } else { if (KT_Helper.isLocalStorageAvailable()) { KT_ECTOKEN = localStorage.getItem('KT_ECTOKEN'); } else { KT_ECTOKEN = KT_Helper.getCookie('KT_ECTOKEN'); } } if (window.jQuery === undefined) { KT_Helper.include_js(JQUERY_URL); } if (window.JSON === undefined) { KT_Helper.include_js(JSON_URL); } if (KT_Helper.isValidKey(KT_ECTOKEN)) { elemId = KT_Helper.getFileNameURL(); if (KT_Helper.isLocalStorageAvailable()) { if (typeof localStorage.getItem(KT_ECTOKEN) !== null && localStorage.getItem(KT_ECTOKEN) !== null && localStorage.getItem(KT_ECTOKEN) != "null") { kt_data = JSON.parse(localStorage.getItem(KT_ECTOKEN)); KT_Helper.populateFields(kt_data); } else { KT_Helper.include_js(KT_APIURL); } } else { KT_Helper.include_js(KT_APIURL); } } }