Skip to main content

Retrieve Comments List

Retrieves a paginated list of comments across all entity types or filtered by specific entity.

Command Name

RetrieveCommentsListQuery

Endpoint

POST /api/core/cmd

Request Parameters

ParameterTypeRequiredDescription
entitystringYesEntity type: "Client", "Loan", "Deposit", or "Policy"
entityIdlongYesFilter by specific entity ID
startDatestringNoFilter by comment date start (YYYY-MM-DD)
endDatestringNoFilter by comment date end (YYYY-MM-DD)
searchTextstringNoSearch in comment text
userIdlongNoFilter by user who added comment
pageNumberintegerNoPage number (default: 1)
pageSizeintegerNoItems per page (default: 20)
isExportbooleanNoExport all results (default: false)

Request Example

{
"Cmd": "RetrieveCommentsListQuery",
"Data": {
"entity": "Client",
"entityId": 12345,
"startDate": "2025-01-01",
"endDate": "2025-12-31",
"pageNumber": 1,
"pageSize": 50
}
}

Response Structure

{
"IsSuccessful": true,
"StatusCode": "00",
"Message": "25/25 records returned.",
"Data": {
"items": [
{
"Id": 1001,
"ClientId": 12345,
"Comment": "Customer expressed interest in savings products during phone call.",
"ClientName": "John Doe",
"ClientEndodedKey": "CLIENT-12345",
"ClientCode": "CL-000123",
"EncodedKey": "abc-123-def",
"AssociatedEntity": "Client",
"AssociatedEntityId": 12345,
"AssociatedEntityNumber": "CL-000123",
"DateCreated": "2025-12-15T10:30:00Z",
"UserName": "jane.doe@banklingo.com"
},
{
"Id": 1002,
"ClientId": 12345,
"Comment": "Approved KYC documentation verified.",
"ClientName": "John Doe",
"ClientEndodedKey": "CLIENT-12345",
"ClientCode": "CL-000123",
"EncodedKey": "abc-123-def",
"AssociatedEntity": "Client",
"AssociatedEntityId": 12345,
"AssociatedEntityNumber": "CL-000123",
"DateCreated": "2025-12-16T14:20:00Z",
"UserName": "john.smith@banklingo.com"
}
],
"PageNumber": 1,
"PageSize": 25,
"TotalPages": 1,
"TotalRecords": 25
},
"Pages": 1,
"HasNext": false,
"HasPrevious": false,
"Size": 25,
"Count": 25
}

Response Fields

FieldTypeDescription
IdlongComment ID
CommentstringComment text
DateCreatedstringComment creation timestamp
UserNamestringUser who created the comment
AssociatedEntitystringEntity type (Client, Loan, Deposit, Policy)
AssociatedEntityIdlongEntity ID
AssociatedEntityNumberstringEntity reference number
ClientIdlongClient ID (if applicable)
ClientNamestringClient name
ClientEncodedKeystringClient encoded key
ClientCodestringClient code
EncodedKeystringComment encoded key

Code Examples

C# Example

Code Removed

Implementation details removed for security.

Contact support for implementation guidance.

JavaScript/TypeScript Example

interface CommentFilters {
entity: 'Client' | 'Loan' | 'Deposit' | 'Policy';
entityId: number;
startDate?: string;
endDate?: string;
searchText?: string;
pageNumber?: number;
pageSize?: number;
}

async function getComments(filters: CommentFilters) {
const response = await fetch('/api/core/cmd', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
},
body: JSON.stringify({
Cmd: 'RetrieveCommentsListQuery',
Data: filters
})
});

return await response.json();
}

// Usage
const result = await getComments({
entity: 'Loan',
entityId: 12345,
pageSize: 50
});

if (result.IsSuccessful) {
console.log(`Found ${result.Count} comments`);
result.Data.items.forEach(comment => {
console.log(`${comment.DateCreated} - ${comment.UserName}: ${comment.Comment}`);
});
}

Python Example

def get_comments(entity: str, entity_id: int, page_size: int = 20):
"""Retrieve comments for an entity."""

url = "https://api.banklingo.com/api/core/cmd"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {token}"
}

data = {
"Cmd": "RetrieveCommentsListQuery",
"Data": {
"entity": entity,
"entityId": entity_id,
"pageSize": page_size
}
}

response = requests.post(url, headers=headers, json=data)
result = response.json()

if result["IsSuccessful"]:
comments = result["Data"]["items"]
print(f"Found {len(comments)} comments")

for comment in comments:
print(f"{comment['DateCreated']} - {comment['UserName']}: {comment['Comment']}")

return result

# Usage
get_comments("Loan", 12345, page_size=50)

Filtering Examples

Filter by Date Range

Get comments within a specific date range:

{
"Cmd": "RetrieveCommentsListQuery",
"Data": {
"entity": "Loan",
"entityId": 12345,
"startDate": "2025-01-01",
"endDate": "2025-01-31"
}
}

Search by Text

Search for specific text in comments:

{
"Cmd": "RetrieveCommentsListQuery",
"Data": {
"entity": "Client",
"entityId": 67890,
"searchText": "approval"
}
}

Filter by User

Get comments by a specific user:

{
"Cmd": "RetrieveCommentsListQuery",
"Data": {
"entity": "Deposit",
"entityId": 54321,
"userId": 101
}
}

Export to Excel

Export all comments to Excel:

{
"Cmd": "RetrieveCommentsListQuery",
"Data": {
"entity": "Policy",
"entityId": 99999,
"isExport": true
}
}

Pagination

The response includes pagination metadata:

{
"Pages": 3,
"HasNext": true,
"HasPrevious": false,
"Size": 20,
"Count": 50
}

To retrieve the next page:

{
"Cmd": "RetrieveCommentsListQuery",
"Data": {
"entity": "Loan",
"entityId": 12345,
"pageNumber": 2,
"pageSize": 20
}
}

Performance Considerations

  • Use pagination for large result sets
  • Filter by date range to reduce data volume
  • Use specific entity IDs rather than broad queries
  • Consider caching results for frequently accessed entities