Contact Free trial Login

Blend Connector - Mule 4

Support Category: Select

Blend stands for Better Lending. It is a platform designed to facilitate the various aspects of consumer lending. While Blend already leverages digitized, source-verified data wherever possible, in reality, the lending process is heavily dependent on paper documents.

Instead of relying on error-prone stare-and-compare techniques to condition a loan, loan teams can unlock data from uploaded documents through computer visioning and take advantage of Blend’s automated follow-up workflow, which allows borrowers to satisfy conditions with 50 percent fewer interactions. This intelligent and efficient experience is one-way. Blend helps lenders keep origination costs down. Automated data validation constantly ensures that the data lifted from uploaded documents are well-formed and complete. If data doesn’t pass the validation check, then these fields will not be used. Real-Time monitoring allows Blend to track trends in computer visioning success rate.

MuleSoft Blend connector offers simplified access to Blend’s APIs to support workflows related to:

  • Loans

  • Borrowers

  • Realtors

  • Documents and Disclosures

Prerequisites

This document assumes that you are familiar with Blend, Mule concepts, Anypoint connectors, Anypoint Studio, the elements in a Mule flow, and global elements.

The APIs use basic authentication, with the username and password are encoded in base64 using the following schema: Basic base65(username, password). So, you need a Blend account and credentials to use the connector. For more information, see Authentication information in Blend’s documentation.

For software requirements and compatibility, see the Connector Release Notes.

To use the Blend connector with Maven, find dependency information on the Dependency Snippets tab of Blend connector’s page on the Anypoint Exchange.

Configure Blend Connector in the Design Center

  1. In the Design Center, create a Mule application.

  2. On the canvas, configure HTTP Listener or Scheduler as a trigger.

  3. Click the + icon to add a component.

  4. Select the Blend Connector.

  5. Select an operation from the list.

  6. Configure the connector’s global element.

    • Address: URL to access Blend API

    • Username: The user name to access Blend API

    • Password: Password to access Blend API, which also serves as an Auth Token.

    • x-blend-deployment: Your Blend deployment name

    • x-blend-special-instance-id: Your special deployment instance ID, if required.

  7. Enter the parameters that are required for the operation.

Install Blend Connector in Anypoint Studio

  1. In Anypoint Studio, click the Exchange icon in the Studio taskbar.

  2. Click Login in Anypoint Exchange.

  3. Search for the Blend connector, and click Add to project.

  4. Follow the prompts to install the connector.

Connector Namespace and Schema

When designing your application in the Anypoint Studio, drag the connector from the palette to the canvas. This action automatically populates the XML code with the connector namespace and schema location.

  • Namespace: http://www.mulesoft.org/schema/mule/blend

  • Schema Location: http://www.mulesoft.org/schema/mule/blend/current/mule-blend.xsd

Configure Blend Connector in Anypoint Studio

  1. In Anypoint Studio, create a new Mule project. Ensure that you have HTTP Listener configured.

  2. Drag the connector to the Studio Canvas.

  3. Configure the connector’s global element. You can either enter your credentials as global configuration properties or reference a configuration file that contains these values. For simpler maintenance and better reuse of your project, MuleSoft recommends that you use a configuration file.

    • Address: URL to access Blend API.

    • Username: The user name to access Blend API.

    • Password: Password to access Blend API, which also serves as an Auth Token.

    • x-blend-deployment: Your Blend deployment name.

    • x-blend-special-instance-id: Your special deployment instance ID, if required.

      An example configuration file for Blend is available at src/main/resources/configuration.yaml. You can add this file in the Configuration Properties of the Global Configuration Elements.
  4. To ensure that your connection is successful, Click Test Connection.

  5. Select a connector operation.

Use Case: Create a Blend Loan User and update Loan Properties

The following use case demonstrates how you can use the Blend connector along with Salesforce connector to:

  • Create a loan in Blend for a Salesforce contact.

  • Update the loan properties in Blend and fetch the loan details.

blend create loan get data

To test this use case:

  1. Create a Mule application and set the connector configuration properties in the configuration file in the src/main/resources. For example:

    blend:
      baseurl: "<url-to-access-blend-api>"
      username: "<username-to-access-blend-api>"
      password: "<password-to-access-blend-api>"
      x-blend-special-instance-id: "<ID-of-your-special-deployment>"
      x-blend-deployment: "<ID-of-your-deployment>"
  2. Add the configuration file for the Blend connector to the Configuration Properties of the Global Configuration Elements.

To create the new Mule application flow:

  1. Drag an HTTP Listener to the canvas and configure it.

  2. From the Mule Palette, search for the Salesforce connector and drag Query operation. To configure the Salesforce operation:

    1. Add your query in the Salesforce query. For the purpose of this demo, use the following query to get the contact from Salesforce.

      SELECT email,firstname, lastname,Id from Contact where id = ':id'
    2. In the Parameters section, create a parameter with id as Name and the contact ID as Value.

  3. Select and drag Transform Message at the flow on the canvas to prepare the input for the Blend connector. Here’s an example of the output payload in the transform message.

    {
      "loanType": "MORTGAGE",
      "applicationType": "FULL_APPLICATION",
      "loanPurposeType": "PURCHASE",
      "propertyType": "SINGLE_FAMILY",
      "propertySearchType": "NOT_STARTED",
      "propertyUsageType": "PRIMARY_RESIDENCE",
      "loanAmount": 100000,
      "propertyValue": 200000,
      "propertyAddress": {
        "streetAddressLine1": "100 Main St",
        "streetAddressLine2": "Apt 10",
        "city": "Chicago",
        "state": "IL",
        "zipCode": "60007",
        "zipCodePlusFour": "1000"
      },
      "borrower": {
        "name": {
    	"firstName": payload[0].FirstName,
    	"middleName": "P",
    	"lastName": payload[0].LastName,
    	"suffixName": "III"
    	},
        "email": payload[0].Email,
        "SSN": "000113933",
        "dateOfBirth": "1992-08-30T19:31:38.902Z",
        "homePhone": "09999999999",
        "currentAddress": {
          "streetAddressLine1": "100 Main St",
          "streetAddressLine2": "Apt 10",
          "city": "Chicago",
          "state": "IL",
          "zipCode": "60007",
          "zipCodePlusFour": "1000"
        }
      },
      "leadId": "leadId1",
      "crmId": "crmId1",
      "losId": "losId1",
      "referenceNumber": "100",
      "sendEmailInvite": true,
      "applicationTemplateId": "",
      "applicationSource": {
        "type": "LOS",
        "name": "Test Borrower"
      }
    }
  4. From Blend operations, drag the Create a Loan connector operation after the transform message. In the configuration options:

    1. Select the connector configuration that you created.

    2. Set the General section in the connector configuration to payload.

    3. Set the Target Value in the Advanced section to #[payload].

  5. From the Mule Palette, search and drag Set Variable operation after the Blend operation, to capture the loan ID returned from Blend into a variable. In the Settings section of the Set Variable operation, set the following:

    1. Name: loanId

    2. Value: #[payload.id]

  6. From Blend operations, drag Update Loan Properties operation. In the configuration options:

    1. Use the following example payload in the Patch loan body of the General section:

      {
      	"losId": "test",
      	"crmId": "crmLead1",
      	"referenceNumber": "13283",
      	"propertyAddress": {
      		"streetAddressLine1": "100 Main St",
      		"streetAddressLine2": "Apt 10",
      		"city": "Chicago",
      		"state": "IL",
      		"zipCode": "60007",
      		"zipCodePlusFour": "1000"
      	},
      	"tridTriggeredDate": "1992-08-30T19:31:38.902Z"
      }
    2. Set the Loan id to #[vars.loanId].

    3. Set the Target Value in the Advanced section to #[payload].

  7. From Blend operations, drag Get Loan Data operation. In the configuration options:

    1. Set Loan id in the General section to #[vars.loanId].

    2. Set the Target Value in the Advanced section to #[payload].

  8. Use another Transform Message component to display the response in JSON format. The output payload of the transform message can be set to the following:

    %dw 2.0
    output application/json
    ---
    payload
  9. Run the application and point your browser to http://localhost:8081/createLoanApplication.

Use Cases XML: Create a Blend Loan User and update Loan Properties

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:blend="http://www.mulesoft.org/schema/mule/blend"
	xmlns:salesforce="http://www.mulesoft.org/schema/mule/salesforce"
	xmlns:http="http://www.mulesoft.org/schema/mule/http"
	xmlns="http://www.mulesoft.org/schema/mule/core"
	xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http
http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/salesforce
http://www.mulesoft.org/schema/mule/salesforce/current/mule-salesforce.xsd
http://www.mulesoft.org/schema/mule/blend
http://www.mulesoft.org/schema/mule/blend/current/mule-blend.xsd
http://www.mulesoft.org/schema/mule/ee/core
http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd">
<flow name="CREATE_LOAN_GET_LOAN_DATA" >
	<http:listener doc:name="8081/loanProcessing" config-ref="HTTP_Listener_config"
	path="/loanProcessing"/>
	<salesforce:query doc:name="Get Salesforce Contact" config-ref="Salesforce_Config">
		<salesforce:salesforce-query >SELECT email,firstname, lastname,Id from Contact where id = ':id'
		</salesforce:salesforce-query>
		<salesforce:parameters ><![CDATA[#[output application/java
---
{
	"id" : "0030o00002lflyEAAQ"
}]]]></salesforce:parameters>
		</salesforce:query>
		<ee:transform doc:name="Convert to JSON">
			<ee:message >
				<ee:set-payload ><![CDATA[{
  "loanType": "MORTGAGE",
  "applicationType": "FULL_APPLICATION",
  "loanPurposeType": "PURCHASE",
  "propertyType": "SINGLE_FAMILY",
  "propertySearchType": "NOT_STARTED",
  "propertyUsageType": "PRIMARY_RESIDENCE",
  "loanAmount": 100000,
  "propertyValue": 200000,
  "propertyAddress": {
    "streetAddressLine1": "100 Main St",
    "streetAddressLine2": "Apt 10",
    "city": "Chicago",
    "state": "IL",
    "zipCode": "60007",
    "zipCodePlusFour": "1000"
  },
  "borrower": {
    "name": {
	"firstName": payload[0].FirstName,
	"middleName": "P",
	"lastName": payload[0].LastName,
	"suffixName": "III"
	},
    "email": payload[0].Email,
    "SSN": "000113933",
    "dateOfBirth": "1992-08-30T19:31:38.902Z",
    "homePhone": "09999999999",
    "currentAddress": {
      "streetAddressLine1": "100 Main St",
      "streetAddressLine2": "Apt 10",
      "city": "Chicago",
      "state": "IL",
      "zipCode": "60007",
      "zipCodePlusFour": "1000"
    }
  },
  "leadId": "leadId1",
  "crmId": "crmId1",
  "losId": "losId1",
  "referenceNumber": "100",
  "sendEmailInvite": true,
  "applicationTemplateId": "",
  "applicationSource": {
    "type": "LOS",
    "name": "Test Borrower"
  }
}]]></ee:set-payload>
			</ee:message>
		</ee:transform>
		<blend:post-loan doc:name="Create a Loan" config-ref="Blend_Config"/>
		<set-variable value="#[payload.id]" doc:name="Save Loan ID" variableName="loanId"/>
		<blend:patch-loan doc:name="Update Loan Properties" config-ref="Blend_Config"
		   loanId='#[vars.loanId]'>
			<blend:patch-loan-body ><![CDATA[#[{
	"losId": "test",
	"crmId": "crmLead1",
	"referenceNumber": "13283",
	"propertyAddress": {
		"streetAddressLine1": "100 Main St",
		"streetAddressLine2": "Apt 10",
		"city": "Chicago",
		"state": "IL",
		"zipCode": "60007",
		"zipCodePlusFour": "1000"
	},

	"tridTriggeredDate": "1992-08-30T19:31:38.902Z"
}]]]></blend:patch-loan-body>
		</blend:patch-loan>
		<blend:get-loan-data doc:name="Get Loan Data" config-ref="Blend_Config" loanId="#[vars.loanId]"/>
		<ee:transform doc:name="Convert to JSON" >
			<ee:message >
				<ee:set-payload ><![CDATA[%dw 2.0
output application/json
---
payload]]></ee:set-payload>
			</ee:message>
		</ee:transform>
	</flow>
</mule>

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.