API – Actions & Results
Introduction
Actions and results are a useful way to standardize notes. This tool helps users determine how often specific actions occur and makes the actions searchable. For more information on actions and results, see our article on how they're used in the UI.
You can also try these requests yourself on our ReadMe page—an interactive API documentation page which lists each of our requests.
Creating Actions and Results
To create new actions and results at the tenant-level, you will need to send two requests: one for a new action and one for a new result.
Creating Actions
To create a new action, send a POST request to the following URL:
POST https://loanpro.simnang.com/api/public/api/1/odata.svc/Actions()?
Your payload should include the following information:
{
"active": 1,
"description": "This Action was created via the API.",
"title": "Action Title",
"ActionResultAssociations": {
"results": [
{
"adjustmentId": 1,
"resultId": 5,
"adjustBase": 1,
"adjustNumber": "3",
"_$resultName": "Change Due Date",
"_$adjustBase": "Current Date",
"_$index": 0
}
]
}
}
Creating Results
To create a new result, send a POST to the following URL:
POST https://loanpro.simnang.com/api/public/api/1/odata.svc/ActionResults()
And here is what your payload should include:
{
"active": 1,
"title": "Result Title",
"description": "This result was created via the API."
}
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 also add multiple actions and results at once by adding more objects to the "results" array.
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
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":""
}
]
}
}