Fetch Third Party Service The "Fetch Third Party Service" endpoint is a crucial component of Lenme's API ecosystem designed to facilitate the retrieval of third-party services integrated with our platform.
These services can encompass a wide range of functionalities, including machine learning scoring models or data pertaining to each borrower within a loan request.
To utilize this API endpoint, developers need to provide two essential parameters: the "loan request ID" and the "Provider Name." With these inputs, the endpoint empowers developers to seamlessly access the specific service offered by the designated third-party provider. Whether it's extracting valuable insights from machine learning models or accessing borrower-specific data, the "Fetch Third Party Service" endpoint simplifies the process of integrating and utilizing external services within the Lenme ecosystem.
HTTP Request
POST
https://api.lenmo.app/api/v3/data_marketplace/data_integration/
This endpoint returns the requested service score for the requested loan ID.
Request Body
200: OK Third Party Score 403: Forbidden Permission Denied 404: Not Found Third Party Score not found 404: Not Found Loan request not found 400: Bad Request Invalid provider name
See the Available Service Options
section for service sample response
Copy {
"detail" : "Authentication credentials were not provided."
}
Copy Service provider score not found for the given loan request ID
Copy No active loan request found for the given id
Copy Please enter a valid provider name
Sample Request
cURL Python Java Ruby Node.Js PHP
Copy curl -X POST "https://api.lenmo.app/api/v3/data_marketplace/data_integration/" \
-H "accept: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "X-Timestamp: REQUEST_TIMESTAMP" \
-H "X-HMAC: REQUEST_HMAC" \
-H "Content-Type: application/json" \
-d '{"loan_request_id": 1, "provider_name": "salus"}'
Copy import requests
import json
api_key = 'YOUR_API_KEY'
api_secret = 'YOUR_API_SECRET'
url = 'https://api.lenmo.app/api/v3/data_marketplace/data_integration/'
headers = {
'Accept' : 'application/json' ,
"Content-Type" : "application/json" ,
'X-API-KEY' : api_key ,
'X-Timestamp' : 'YOUR_TIME_STAMP' ,
'X-HMAC' : 'YOUR_HMAC_KEY'
}
loan_request_id = 1
provider_name = "salus"
data = {
"loan_request_id" : loan_request_id ,
"provider_name" : provider_name
}
r = requests . post (url, headers = headers, json = data)
print (r.text)
Copy import java . io . OutputStream ;
import java . io . InputStreamReader ;
import java . io . BufferedReader ;
import java . net . HttpURLConnection ;
import java . net . URL ;
public class Main {
public static void main ( String [] args) {
try {
String apiKey = "YOUR_API_KEY" ;
String apiSecret = "YOUR_API_SECRET" ;
String urlString = "https://api.lenmo.app/api/v3/data_marketplace/data_integration/" ;
URL url = new URL(urlString) ;
HttpURLConnection connection = (HttpURLConnection) url . openConnection ();
connection . setRequestMethod ( "POST" );
connection . setRequestProperty ( "Accept" , "application/json" );
connection . setRequestProperty ( "Content-Type" , "application/json" );
connection . setRequestProperty ( "X-API-KEY" , apiKey);
connection . setRequestProperty ( "X-Timestamp" , "YOUR_TIME_STAMP" );
connection . setRequestProperty ( "X-HMAC" , "YOUR_HMAC_KEY" );
connection . setDoOutput ( true );
int loanRequestId = 1 ;
String providerName = "salus" ;
String jsonInputString = String.format("{\"loan_request_id\": %d, \"provider_name\": \"%s\"}", loanRequestId, providerName);
try ( OutputStream os = connection . getOutputStream ()) {
byte [] input = jsonInputString . getBytes ( "utf-8" );
os . write (input , 0 , input . length );
}
BufferedReader in = new BufferedReader( new InputStreamReader( connection . getInputStream() , "utf-8" )) ;
String inputLine;
StringBuilder response = new StringBuilder() ;
while ((inputLine = in . readLine ()) != null ) {
response . append (inputLine);
}
in . close ();
System . out . println ( response . toString ());
} catch ( Exception e) {
e . printStackTrace ();
}
}
}
Copy require 'net/http'
require 'json'
require 'openssl'
require 'time'
api_key = 'YOUR_API_KEY'
api_secret = 'YOUR_API_SECRET'
url = URI ( 'https://api.lenmo.app/api/v3/data_marketplace/data_integration/' )
timestamp = Time . now . to_i . to_s
message = timestamp + url . to_s
signature = OpenSSL :: HMAC . hexdigest( 'sha256' , api_secret , message)
headers = {
'Accept' => 'application/json' ,
'Content-Type' => 'application/json' ,
'X-API-KEY' => api_key ,
'X-Timestamp' => timestamp ,
'X-HMAC' => signature
}
data = {
loan_request_id: 1 ,
provider_name: "salus"
} . to_json
http = Net :: HTTP . new (url . host , url . port)
http . use_ssl = true
request = Net :: HTTP :: Post . new (url , headers)
request . body = data
response = http . request(request)
puts response . read_body
Copy const fetch = require ( 'node-fetch' );
const apiKey = 'YOUR_API_KEY' ;
const apiSecret = 'YOUR_API_SECRET' ;
const url = 'https://api.lenmo.app/api/v3/data_marketplace/data_integration/' ;
const headers = {
"Accept" : "application/json" ,
"Content-Type" : "application/json" ,
"X-API-KEY" : apiKey ,
"X-Timestamp" : "YOUR_TIME_STAMP" ,
"X-HMAC" : "YOUR_HMAC_KEY" ,
};
const data = {
loan_request_id : 1 ,
provider_name : "salus"
};
fetch (url , {
method : 'POST' ,
headers : headers ,
body : JSON .stringify (data)
})
.then (response => response .text ())
.then (data => console .log (data))
.catch (error => console .error ( 'Error:' , error));
Copy <? php
$apiKey = 'YOUR_API_KEY' ;
$apiSecret = 'YOUR_API_SECRET' ;
$url = "https://api.lenmo.app/api/v3/data_marketplace/data_integration/" ;
$headers = [
"Accept: application/json" ,
"Content-Type: application/json" ,
"X-API-KEY: $apiKey" ,
"X-Timestamp: YOUR_TIME_STAMP" ,
"X-HMAC: YOUR_HMAC_KEY"
];
$body = json_encode ( [
"loan_request_id" => 1 ,
"provider_name" => "salus"
] ) ;
$ch = curl_init () ;
curl_setopt ( $ch , CURLOPT_URL , $url ) ;
curl_setopt ( $ch , CURLOPT_RETURNTRANSFER , true ) ;
curl_setopt ( $ch , CURLOPT_HTTPHEADER , $headers ) ;
curl_setopt ( $ch , CURLOPT_POST , true ) ;
curl_setopt ( $ch , CURLOPT_POSTFIELDS , $body ) ;
$response = curl_exec ( $ch ) ;
if ( curl_errno ( $ch ) ) {
echo 'Error:' . curl_error ( $ch ) ;
} else {
echo $response;
}
curl_close ( $ch ) ;
?>
Available Service Options
Salus Score Description *
Salus Score uses credit data and transaction data to highlight the historically observed default rate of a given loan application based on similar historical applications, going beyond traditional measures like credit score. Users of the Salus Score acknowledge that the Salus Score is for informational purposes only and should not be solely relied on to make credit decisions; it is not guaranteed to generate default rates consistent with historical patterns used to generate the score. Salus Score is provided by Lenme’s data partner, Salus Financial Technology, Inc. Salus Financial Technology, Inc. is not a credit reporting agency. Information like age, sex, race, or marital status are not used in the creation of the Salus Score. Users of the Salus Score allow Lenme to share loan data with Salus Financial Technology, Inc.