Jxp api guide

API endpoint = http://subdomain.journeyxp.com/io/http

Make a http get request to the api endpoint with your parameters.

Requests must contain cid, did and any parameter you have defined as required.


Table of contents














Examples:

jxpsubmitter-example

This example uses our jxp-submitter script. This is the recommended method for accessing our api as it implements support for grabbing variables automatically. It also sets cookies to help track your leads.
Documentation for the script can be found here

<script src="//track.adform.net/Serving/Cookie/?adfaction=getjs;adfcookname=uid"></script>
<script type="text/javascript" src="//jxp.dk/autosetup/jxp-implementation2.3.js.php"></script>
<script>
    jxpinitialize();
    jxpsubmitter("subdomain", "formtosubmit", cid, did, false);
</script>

php-example

function replace_first($find, $replace, $subject) {
    return implode($replace, explode($find, $subject, 2));
}

$parameters = [ "did" => "10", "cid" => "20", "phone" => "51515151", "firstname" => "Alan", "lastname" => "Turing" ]; //these are just example parameters
$api = 'http://subdomain.journeyxp.com/io/http?'; //change subdomain to your domain
$targeturl = $api;
foreach ($parameters as $key => $value) {
    $targeturl = $targeturl . "&" . $key . "=" . $value;
}
$targeturl = replace_first("?&", "?", $targeturl);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $targeturl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$return = curl_exec ($ch);
curl_close ($ch);

echo $return;

javascript-example

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> //only include this if you have not already loaded jquery

<script>
var jxpdomain = "somedomain"
var jxpdata = {did:45, cid:20, phone:51515151, firstname:"alan", lastname:"turing"} //these are just example parameters

$.ajax({
    method: "GET",
    dataType: "jsonp",
    crossDomain: true,
    url: "http://"+jxpdomain+".journeyxp.com/io/http",
    data: jxpdata,
});
</script>



Response codes:


Objective of this document
This document describes the returned responses when a lead is submitted to JourneyXP system

Description:
When a lead is submitted to JourneyXP system the caller will receives a JSON object as a response to the submitted lead, to indicated if the lead was accepted or rejected and to what reasons.

All the field names of the JSON object are strictly lower case characters from [a- z]
The returned JSON object contains the following fields:
1- status: which to indicate if the lead was accepted or lead is invalid
2- errorcode: which contains the error codes for the response. In case if no errors a 0 (zero) value is in this field
3- message: This field contains details about the submit transaction and the details of the error or warning if any.


Case when Lead is Accepted:
The following returned JSON values will be returned when the lead is saved and therefore accepted.
- { "status":"success", "errorcode":"0" "message": "Lead was saved"}


Case when Lead is Invalid:
In case of failure or the lead was invalid the following JSON properties will be in the returned code.

1- the status field is set to "failed" when the lead is rejected or an error in the transaction

2- errorcode is set to non zero numeric value which refers to the error type or the rejection reasons. The “failed” result is enough value to indicate that the lead was not accepted.

3- The message field is set with the description of the failure as per the following:
A- in case the lead was not saved, the text "Lead not saved" appears in the "message" field of the returned JSON, as there can be cases that enforces the system to save the lead while it is still being an invalid lead.


B- in case the lead is invalid the text "Lead is invalid due to the following reason ......." appears in the returned code and the "...." is the explanation for the reason why the lead is invalid, in case there was no explicable reason provided the text is just plainly "Lead is invalid", this could be due to user defined rules in the validation rules.

- { "status":"failed", "errorcode":"9999", "message": "Lead not saved, Lead is invalid due to the following reason: Lead is a duplicate" }

- { "status":"failed", "errorcode":"9998", "message": "Lead not saved, Lead is invalid due to the following reason: Lead has been contacted in past 6 months"}

- { "status":"failed", "errorcode":"9997", "message": "Lead is invalid due to the following reason: Lead was already in the same group"}

- { "status":"failed", "errorcode":"9996", "message": "Lead is invalid due to the following reason: Lead is already customer"}

- { "status":"failed", "errorcode":"9995", "message": "Lead was not saved, Lead is invalid due to the following reason: Lead data could not be properly mapped"}

- { "status":"failed", "errorcode":"9994", "message": "Lead is invalid due to the following reason: Lead failed name validation"}

- { "status":"failed", "errorcode":"9993", "message": "Lead is invalid due to the following reason: Lead failed IP validation"}

- { "status":"failed", "errorcode":"9992", "message": "Lead is invalid due to the following reason: Lead failed email validation"}

- { "status":"failed", "errorcode":"9991", "message": "Lead is invalid due to the following reason: Lead failed phone validation"}

- { "status":"failed", "errorcode":"9990", "message": "Lead was not saved, Lead is invalid due to the following reason: Lead found on blacklist"}

- {"status":"failed","errorcode":"9989","message":"Lead was not saved, Lead is invalid due to the following reason: Lead was missing mandatory data"}

- { "status":"failed", "errorcode":"9988", "message": "Lead was not saved, Lead is invalid due to the following reason: Channel has expired"}

- { "status":"success", "errorcode" : "9987", "message": "lead was saved. Warning ! The callback URL is missing on channel driver"}

- { "status":"success", "errorcode" : "9986", "message": "Lead was saved. Warning ! The callback URL is set but the fpin is missing"}

- { "status":"failed", "errorcode": "1001", "message":'Lead was not saved, Lead is invalid due to the following reason: The channel and driver capacity met'}

- { "status":"failed", "errorcode":"1002", "message": "Lead was not saved, Driver or channel missing in the sent parameters"}

- { "status":"failed", "errorcode": "1003", "message": "Lead was not saved, Parameters were not read. Either all parameters are not present, or you sent a wrong request'"}

- { "status":"failed", "errorcode": "1004", "message": "Lead was not saved, Channel invalid. Either the request was sent to the wrong channel, or the channel has been deactivated/closed"}

- { "status":"failed", "errorcode": "1005", "message": "Lead was not saved, Lead is invalid due to the following reason: Combination of channel, driver is not correct or channel, driver, token is invalid. Check your configuration"}

- { "status":"failed", "errorcode":"1006" ,"message": "Lead was not saved, Neither one parameters has been sent"}

- { "status":"failed", "errorcode": "1007", "message": "Lead was not saved, Permission not recognized"}

- { "status":"failed", "errorcde": "1008", "message": "Lead was not saved, error while saving lead details, check lead attributes or
attempt a resend"}

Inputfields:

fieldnamedescriptionformatexample
cidchannel idint32
diddriver idint56
firstnamefirstnamestringtore
lastnamelastnamestringsørensen
middlenamemiddlenamestringpoulsen
emailemailstringdevtest@journeyxp.com
streetnamestreetnamestringNordsøvej
househouse no.int8
zipzip codeint2150
citycitystringnordhavn
floorfloorint2
doordoorstringa
letterhouse letterstringb
phonephone primaryint89 88 01 40
phone1phone1int89 88 01 40
ipv4ip addressxxx.xxx.xxx.xxx80.161.189.193
gendergender (male/female)m/f or male/femalemale
birthdatebirthdateyyyy-mm-dd1991-10-10
customX (1-4)custom fieldstringanything goes here
nn_tdc_idnn_tdc_id????????????????
cvrcvrint99999999
company_namecompany_namestringjourneyxp
industry_codeindustry_code????????????
industry_textindustry_text???????????
employeesamount of employeesint250
corporate_formcorporate_form????????????
websitewebsitestring with double quotes"http://jxp.datahandler.io"
date_of_establishmentdate of establishment???????????????
contact_personcontact person????????????
credit_scorecredit score????????????
question_X (1-20)question fieldstringanything goes here