Developer Documenation: Working Capital API – Application Status
Json request structure
- Submit your request in POST
- Headers need to include:
- Content-Type : application/json
- x-api-key : Your API Key
- Authorization : Basic Auth
- With your username & password as a base64 encoded string
- Body must be as an array which should be formatted as shown in the jQuery, javascript and PHP examples to the right
Testing
For initial testing and setup we recommend using postman as your platform to ensure you are preparing and formatting your requests properly. Once you have your structure setup correctly we’ve prepared some basic examples to the right for you to start with while using testdevportal.
Legend
While testing, please use testdevportal. When ready for production, be sure change it to devportal.
The highlighted areas you see in the examples to the right represent the variables which will need to be filled with your data. These are sensitive so ensure you are loading them from a remote and secure source.
jQuery( function( $ ) {
// These variables should be populated from a remote & secure source
var applicationNumber = '',
partnerReferenceId = 'CD1911270045',
username = '********',
password = '********',
xApiKey = '********-********-********-********',
requri = 'https://testdevportal.marlincapitalsolutions.com:8077/ws/rest/appstatus/v1/applicationStatusApi/';
callWCStatus( applicationNumber, partnerReferenceId, username, password, xApiKey, requri );
function callWCStatus( applicationNumber, partnerReferenceId, username, password, xApiKey, requri ) {
var jsonRequest = {
'Application Number': applicationNumber,
'Partner Reference Id': partnerReferenceId
},
jsonHeaders = {
'Authorization': 'Basic ' + btoa( username + ':' + password ),
'x-api-key': xApiKey
};
$.ajax( {
type: 'POST',
url: requri,
headers: jsonHeaders,
data: JSON.stringify( jsonRequest ),
contentType: 'application/json',
success: function( json ) {
if ( 'true' === json[ 'Status' ] ) {
// Good response, now to do something with it.
console.log( 'success' );
console.log( json )
} else if ( false === json[ 'Status' ] ) {
console.log( 'successful connection but no data in the response' );
console.log( json['Message'] )
} else {
console.log( 'successful connection but we have an unexpected response' );
console.log( json )
}
}, // End Success
error: function( json ) {
// Something has happened with the communication and we need to do something here.
console.log( 'error with connection' );
console.log( json );
} // End Error
} ); // End Ajax
} // End callWCStatus
}); // End Jquery
// These variables should be populated from a remote & secure source
var applicationNumber = '',
partnerReferenceId = 'CD1911270045',
username = '********',
password = '********',
xApiKey = '********-********-********-********-********',
requri = 'https://testdevportal.marlincapitalsolutions.com:8077/ws/rest/appstatus/v1/applicationStatusApi/';
var xhr = new XMLHttpRequest();
xhr.open('POST', requri);
xhr.setRequestHeader('Accept', 'application/json' );
xhr.setRequestHeader('Authorization', 'Basic ' + btoa( username + ':' + password ) );
xhr.setRequestHeader('x-api-key', xApiKey );
xhr.setRequestHeader('Content-Type', 'application/json' );
xhr.onreadystatechange = function() {
if ( xhr.readyState === 4 ) {
var respCode = xhr.status,
respData = xhr.responseText;
if ( 200 === respCode ) {
// Good response, now to do something with it.
var jsonArr = JSON.parse( respData ),
respStatus = jsonArr[ 'Status' ],
respMessage = jsonArr[ 'Message' ];
if ( true === respStatus ) {
// Good response, now to do something with it.
console.log( 'success' );
console.log( respMessage );
} else if ( false === respStatus ) {
console.log( 'successful connection but no data in the response' );
console.log( respMessage );
} else {
console.log( 'successful connection but we have an unexpected response' );
console.log( respData )
}
} else {
// We did not get a good response status
console.log('bad response code');
console.log( responseCode );
console.log( respData );
}
}
};
xhr.send( JSON.stringify( data ) );
<?php
// These variables should be populated from a remote & secure source
$url = "https://testdevportal.marlincapitalsolutions.com:8077/ws/rest/appstatus/v1/applicationStatusApi/";
$application_number = '';
$partner_reference_id = 'CD1911270045';
$username = '********';
$password = '********';
$x_api_key = '********-********-********-********-********';
$data = [
'Application Number' => $application_number,
'Partner Reference Id' => $partner_reference_id,
];
$curl = curl_init( $url );
curl_setopt( $curl, CURLOPT_URL, $url );
curl_setopt( $curl, CURLOPT_POST, true );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
$headers = array(
'Accept: application/json',
'Content-Type: application/json',
'Authorization: Basic ' . base64_encode( $username . ':' . $password ),
'x-api-key: ' . $x_api_key,
);
curl_setopt( $curl, CURLOPT_HTTPHEADER, $headers );
$json_data = json_encode( $data );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $json_data );
// FOR DEBUGGNIG ONLY!! DO NOT USE IN PRODUCTION
curl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, false );
curl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );
// END DEBUGGING
$resp = json_decode( curl_exec( $curl ) );
curl_close( $curl );
if ( isset( $resp->Status ) ) {
// We have a response lets confirm what it is and go from there.
if ( true == $resp->Status ) {
// Good response, now to do something with it.
var_dump( 'successful connection' );
var_dump( $resp );
} elseif ( false == $resp->Status ) {
var_dump( 'successful connection but no data in the response' );
var_dump( $resp );
} else {
var_dump( 'successful connection but we have an unexpected response' );
var_dump( $resp );
}
} else {
var_dump( 'Bad response, no status detected' );
var_dump( $resp );
}
JSON Field Name | Required/Optional | Format | Sample Values |
---|---|---|---|
Application Number | Required(Either Partner Reference Id /Application Number is Required) | String | L021166 |
Partner Reference ID | Required(Either Partner Reference Id /Application Number is Required) | String | CD1911270045 |
Note:
- Please pass in mentioned JSON Format. Else Dell Boomi - Application Status Fetch API will fail.
- If values are not present/Optional please pass empty (" ") value to field name.
Sample Request JSON
{
"totalCost": "5000",
"equipmentType" : "Office Furniture"
}
Sample Response JSON
{
"Status": "true",
"Message": "Success",
"Application Status": "Pending Decision"
}
HTTP Method | POST |
---|---|
Development Environment | |
URL | https://
|
Headers | |
content-type | application/json |
x-api-key | YOUR DEV X API KEY |
Authorization | |
Type: Basic Auth | Username: YOUR DEV USERNAME Password: YOUR DEV PASSWORD |
Production Environment | |
URL | https://
|
Headers | |
content-type | application/json |
x-api-key | YOUR X API KEY |
Authorization | |
Type: Basic Auth | Username: YOUR USERNAME Password: YOUR PASSWORD |