Skip to main content

Retrieve Policy Comments

Retrieves all comments for a specific insurance policy.

Command Name

RetrievePolicyCommentListQuery

Endpoint

POST /api/core/cmd

Request Parameters

ParameterTypeRequiredDescription
policyIdlongYesInsurance policy ID
pageNumberintegerNoPage number (default: 1)
pageSizeintegerNoItems per page (default: 20)
isExportbooleanNoExport all results (default: false)

Request Example

{
"Cmd": "RetrievePolicyCommentListQuery",
"Data": {
"policyId": 99999,
"pageNumber": 1,
"pageSize": 50
}
}

Alternative: Use RetrieveCommentsListQuery

You can also use the generic command:

{
"Cmd": "RetrieveCommentsListQuery",
"Data": {
"entity": "Policy",
"entityId": 99999,
"pageSize": 50
}
}

Response Structure

{
"IsSuccessful": true,
"StatusCode": "00",
"Message": "12/12 records returned.",
"Data": {
"items": [
{
"Id": 4001,
"ClientId": 67890,
"Comment": "Premium payment received. Policy now active.",
"ClientName": "Robert Johnson",
"ClientEndodedKey": "CLIENT-67890",
"ClientCode": "CL-000789",
"EncodedKey": "POL-99999",
"AssociatedEntity": "Policy",
"AssociatedEntityId": 99999,
"AssociatedEntityNumber": "POL-99999",
"DateCreated": "2025-12-24T11:00:00Z",
"UserName": "policy.admin@banklingo.com"
}
],
"PageNumber": 1,
"PageSize": 12,
"TotalPages": 1,
"TotalRecords": 12
}
}

Code Example

async function getPolicyComments(policyId: 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: 'RetrievePolicyCommentListQuery',
Data: { policyId, pageSize }
})
});

return await response.json();
}

// Usage
const comments = await getPolicyComments(99999, 50);