Retrieve Loan Comments
Retrieves all comments for a specific loan account.
Command Name
RetrieveLoanCommentListQuery
Endpoint
POST /api/core/cmd
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
loanId | long | Yes | Loan account ID |
pageNumber | integer | No | Page number (default: 1) |
pageSize | integer | No | Items per page (default: 20) |
isExport | boolean | No | Export all results (default: false) |
Request Example
{
"Cmd": "RetrieveLoanCommentListQuery",
"Data": {
"loanId": 12345,
"pageNumber": 1,
"pageSize": 50
}
}
Alternative: Use RetrieveCommentsListQuery
You can also use the generic command:
{
"Cmd": "RetrieveCommentsListQuery",
"Data": {
"entity": "Loan",
"entityId": 12345,
"pageSize": 50
}
}
Response Structure
{
"IsSuccessful": true,
"StatusCode": "00",
"Message": "10/10 records returned.",
"Data": {
"items": [
{
"Id": 2001,
"ClientId": 67890,
"Comment": "Loan application approved by credit committee.",
"ClientName": "John Doe",
"ClientEndodedKey": "CLIENT-67890",
"ClientCode": "CL-000456",
"EncodedKey": "LOAN-12345",
"AssociatedEntity": "Loan",
"AssociatedEntityId": 12345,
"AssociatedEntityNumber": "LOAN-12345",
"DateCreated": "2025-12-20T14:30:00Z",
"UserName": "credit.officer@banklingo.com"
}
],
"PageNumber": 1,
"PageSize": 10,
"TotalPages": 1,
"TotalRecords": 10
}
}
Code Example
async function getLoanComments(loanId: number, pageSize: number = 20) {
const response = await fetch('/api/core/cmd', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
},
body: JSON.stringify({
Cmd: 'RetrieveLoanCommentListQuery',
Data: { loanId, pageSize }
})
});
return await response.json();
}
// Usage
const comments = await getLoanComments(12345, 50);
Related Commands
- Add Comment - Add a comment to a loan
- Retrieve Comments List - Generic comment query with more filters