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
| Parameter | Type | Required | Description |
|---|---|---|---|
entity | string | Yes | Entity type: "Client", "Loan", "Deposit", or "Policy" |
entityId | long | Yes | Filter by specific entity ID |
startDate | string | No | Filter by comment date start (YYYY-MM-DD) |
endDate | string | No | Filter by comment date end (YYYY-MM-DD) |
searchText | string | No | Search in comment text |
userId | long | No | Filter by user who added comment |
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": "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
| Field | Type | Description |
|---|---|---|
Id | long | Comment ID |
Comment | string | Comment text |
DateCreated | string | Comment creation timestamp |
UserName | string | User who created the comment |
AssociatedEntity | string | Entity type (Client, Loan, Deposit, Policy) |
AssociatedEntityId | long | Entity ID |
AssociatedEntityNumber | string | Entity reference number |
ClientId | long | Client ID (if applicable) |
ClientName | string | Client name |
ClientEncodedKey | string | Client encoded key |
ClientCode | string | Client code |
EncodedKey | string | Comment 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
Related Commands
- Add Comment - Add a new comment
- Retrieve Client Comments - Get client-specific comments
- Retrieve Loan Comments - Get loan-specific comments
- Retrieve Deposit Comments - Get deposit-specific comments
- Retrieve Policy Comments - Get policy-specific comments