Implementation Example
Overview
This page will cover the "order of operations" for common integration use cases utilizing Blend Events.
Here the term "integration" means any service that is programmatically interfacing with Blend.
This service can be built by a Blend partner, or by a Blend customer directly.
Application Submitted
Summary
One of the most common starting points for an integration is to record when a loan application is submitted by a borrower or a lender (on a borrower's behalf). Blend emits the applicationEvent.SUBMITTED
event in this case. Here, we discuss a normal flow for processing, with the following assumptions:
- We are working in a Beta environment.
- Integration processing of the loan is successful, and we respond to Blend as such.
Pre-Requisites
If you wish to follow along with this guide step-by-step, you must:
- Have API credentials that allow you access to Blend's API.
- Have a functional Beta / UAT instance of Blend.
- Have a functional Beta / UAT subscription to Blend's events.
The Flow
1. Borrower submits application in Blend
2. Blend's service sends event notification to Integration service
{
"eventType": "applicationEvent",
"eventId": "3e2a90aa-9f7d-4078-98aa-2a4e2463cfc3",
"message": {
"entityAction": "SUBMITTED",
"entityType": "loan",
"entityId": "f6e10b3b-abc6-4d2e-952c-f26410f86850"
},
"status": "EMITTED",
"originallyEmittedAt": 1522110211245
}
3. Integration fetches the loan file from the API
Fetch FNMA 3.2 file
curl -X GET \
https://api.beta.blendlabs.com/loans/f6e10b3b-abc6-4d2e-952c-f26410f86850?format=fannie&version=3.2 \
-H 'Authorization: Basic ${MY_DEPLOYMENT_NAME}' \
-H 'Blend-API-Version: 2.1.0' \
-H 'Content-Type: application/json' \
-H 'X-Blend-Deployment: ${MY_DEPLOYMENT_NAME}' \
-H 'X-Blend-Special-Instance-Id: ${MY_INSTANCE_ID}' \
-H 'cache-control: no-cache' \
OR Fetch MISMO 3.3.1 file API Call
curl -X GET \
https://api.beta.blendlabs.com/loans/f6e10b3b-abc6-4d2e-952c-f26410f86850?format=mismo&version=3.3.1 \
-H 'Authorization: Basic ${MY_DEPLOYMENT_NAME}' \
-H 'Blend-API-Version: 2.1.0' \
-H 'Content-Type: application/json' \
-H 'X-Blend-Deployment: ${MY_DEPLOYMENT_NAME}' \
-H 'X-Blend-Special-Instance-Id: ${MY_INSTANCE_ID}' \
-H 'cache-control: no-cache' \
4. Integration service processes import to the LOS that event is processing
curl -X POST \
https://api.beta.blendlabs.com/events/3e2a90aa-9f7d-4078-98aa-2a4e2463cfc3 \
-H 'Authorization: Basic ${MY_DEPLOYMENT_NAME}' \
-H 'Blend-API-Version: 2.1.0' \
-H 'Content-Type: application/json' \
-H 'X-Blend-Deployment: ${MY_DEPLOYMENT_NAME}' \
-H 'X-Blend-Special-Instance-Id: ${MY_INSTANCE_ID}' \
-H 'bons-profile: ${MY_PROFILE_ID}' \
-H 'cache-control: no-cache' \
-d '{"status": "PROCESSING"}'
5. Integration service patches loan via Blend API
curl -X PATCH \
https://api.beta.blendlabs.com/loans/f6e10b3b-abc6-4d2e-952c-f26410f86850 \
-H 'Authorization: Basic ${MY_DEPLOYMENT_NAME}' \
-H 'Blend-API-Version: 2.1.0' \
-H 'Content-Type: application/json' \
-H 'X-Blend-Deployment: ${MY_DEPLOYMENT_NAME}' \
-H 'X-Blend-Special-Instance-Id: ${MY_INSTANCE_ID}' \
-H 'cache-control: no-cache' \
-d '{"losId": "UAT01000000001250384", "referenceNumber": "2300340799"}'
6. Integration service posts to Blend's service with success
curl -X POST \
https://api.beta.blendlabs.com/events/3e2a90aa-9f7d-4078-98aa-2a4e2463cfc3 \
-H 'Authorization: Basic ${MY_DEPLOYMENT_NAME}' \
-H 'Blend-API-Version: 2.1.0' \
-H 'Content-Type: application/json' \
-H 'X-Blend-Deployment: ${MY_DEPLOYMENT_NAME}' \
-H 'X-Blend-Special-Instance-Id: ${MY_INSTANCE_ID}' \
-H 'bons-profile: ${MY_PROFILE_ID}' \
-H 'cache-control: no-cache' \
-d '{"status": "SUCCEEDED"}'
Updated over 3 years ago