API – Actions & Results

Introduction

Actions and results are a good way to standardize notes, so it can be determined how often specific actions and results occur, and facilitate searches for those actions and results. For more information on actions and results, see our article on how they're used in the UI.

Setup

You can add new actions or results to loans through the API, but you can only create new actions and results that are available to add to loans through the LoanPro UI. You can navigate to actions and results within the LoanPro UI from Loan > Servicing > Notes and Alerts > Action and Results.

Adding Actions and Results to a Loan

To add actions and results to a loan, send a POST request to this endpoint:

POST https://loanpro.simnang.com/api/public/api/1/odata.svc/ActionResultNotes

Your payload needs to look something like this:

{  
"note":"<p>Test Note (Can contain HTML)</p>",
"loanId":"${loanId}",
"ActionResultSelectionItems":{
"results":[
{
"Action":{
"__id":1
},
"Result":{
"__id":2
}
}
]
}
}

You can add multiple actions and results at once by adding more objects to the "results" array. The StackBlitz example below demonstrates how to add actions and results to a loan.

What is StackBlitz?
Many of our articles use StackBlitz examples like this. These examples are like a window into a REST client right here in your browser. The window is divided into two sides. Developers can use info in the editor on the left side when configuring your API integration, and the right side shows a preview of a REST client. Click 'Preview' on the bottom, and you'll only see the REST client.

The entire request is set up and connected to a demo API tenant in LMS. Just scroll down and click 'send' and you should get a 200 response. If you want to get some practice with error codes, try editing the endpoint, headers, method and payload to see what responses you get.

Getting Actions

You will likely want to pull the information about your actions and results first. To do this, send a GET request to this endpoint:

GET https://loanpro.simnang.com/api/public/api/1/odata.svc/Actions

The StackBlitz example below shows how to pull this information.

Actions and Results Report

You can also use the API to pull a report of actions and results. To do this, send a POST request to this endpoint:

POST https://loanpro.simnang.com/api/public/api/1/Autopal.ActionResultsReport

Your payload will define your query parameters. Here is a sample payload:

{  
"query":null,
"reportOptions":{
"period":"today",
"dateFrom":"2019-03-07T00:00:01",
"dateTo":"2019-03-07T23:59:59",
"differenceByDate":"0",
"actions":[
{
"id":0,
"title":"Any"
}
],
"results":[
{
"id":0,
"title":"Any"
}
],
"customFields":{

},
"dateEnteredFrom":null,
"dateEnteredTo":null,
"selectedPortfolios":[
{
"category":"",
"portfolio":"",
"subportfolio":""
}
]
}
}

Many of our articles use StackBlitz examples like this. These examples are like a window into a REST client right here in your browser. The window is divided into two sides. Developers can use info in the editor on the left side when configuring your API integration, and the right side shows a preview of a REST client. Click 'Preview' on the bottom, and you'll only see the REST client.

The entire request is set up and connected to a demo API tenant in LMS. Just scroll down and click 'send' and you should get a 200 response. If you want to get some practice with error codes, try editing the endpoint, headers, method and payload to see what responses you get.


How did we do?


Powered by HelpDocs (opens in a new tab)