Integration
IntroductionOverview
For the first phase of integration between MyCRM and the Mortgage Recommendation Engine (MRE), it was decided to use the MRE's user interface for viewing results – instead of directly integrating the MRE API and rendering the results inside MyCRM's own UI. To support this approach, an API endpoint was provisioned that allows MyCRM to send the customer's lending scenario data to the MRE backend, from where it can then be loaded up into MyCRM,the we'veMRE's decidedUI to:and calculated.
AddMyCRM sends data to the MRE's Create Session endpoint- MRE stores the data as a
way"session" and returns the ID toopen MRE (iframe or new tab) fromMyCRMwith ready loaded data for generating a report - MyCRM
willloadscommunicatethetosessionMREindatathe(inputs) required to calculate a specific case via an endpoint provided by MRE -MRE'sCreateusera sessioninterface DataMRE calculates the lending scenario and displays the results
Integration Process
The steps below summarise the MyCRM integration process:
There is storedcurrently inno "sessions"automated whichintegration canof beresult loadeddata byback passingto MyCRM; this is proposed for a sessionfuture IDphase. asThe URLMRE parameterUI todoes BlackFinhowever hostedinclude frontendan Export PDF feature for manual saving of MREresult tool - https://mre.blackfin.tools/
API
Server to server API
The MRE exposes a RESTful API which uses standard HTTP response codes, authentication, and verbs, and uses JSON payloads. The API is hosted on environment-specific domains:
| Environment | API Base URL |
| Test | https://api.mre.test.blackfin.tools/ |
| Production | https://api.mre.blackfin.tools/ |
Endpoints
API endpoints are represented as paths appended to the base URL. For example, create a session endpoint URL is:
https://api.mre.test.blackfin.tools/sessions/create
Authentication
The API uses the Bearer token authentication method. That meansThe HTTP Header Authorization shouldHeader must contain the following string:
Bearer <API_KEY>
Where <API_KEY> is replaced by the API key issued to you by BlackFin.
Endpoints
API endpoints are represented as paths appended to the base URL. Currently, only one endpoint is utilised by the MyCRM integration:
- Create Session – this endpoint accepts data about an applicant's lending scenario / finances, and stores it as a "session" in the database. It returns a
session_idthat can be used to access the data within the MRE's UI.
- Endpoint path:
/sessions/create - Example URL:
https://api.mre.test.blackfin.tools/sessions/create
- Endpoint path:
The API also includes a Generate Report endpoint which performs the MRE calculations and returns the raw result data (JSON), however this is not currently used by MyCRM directly.
User Interface
The Mortgage Recommendation Engine UI can be accessed at the below addresses:
| Environment | Web URL |
| Test | https://mre.test.blackfin.tools/ |
| Production | https://mre.blackfin.tools/ |
The UIMRE does not currently require enforce any authentication to access the UI, however NZFSG have proposed restricting access in future if the URL does not contain a valid session_id (see below).
URL Params
The following query string parameters can be appended to the URL when access the user interface:
- session_id – Including this parameter on the end of the URL triggers the MRE to load and calculate the data from a previously created session. This is a key component of the MyCRM integration.
For examplehttps://mre.test.blackfin.tools/?session_id=BYWSw2DTUBuHVMW4ZdhK - lenders – Including this parameter of comma-separated lender codes instructs the MRE which lenders to calculate for when using the UI in "manual entry" mode (instead of pre-loading session data). This is optional.
For examplehttps://mre.test.blackfin.tools/?lenders=aia,asb,anz,bnz,westpac