Reports API Reference
Reports API Reference
The Reports API provides programmatic access to retrieve various operational and business reports from the Claim Processing System. This allows for integration with dashboards, analytical tools, or custom client applications to monitor claim statuses and overall system performance.
Authentication
All endpoints in the Reports API require authenticated access. Clients must present a valid OAuth2 access token in the Authorization header as a Bearer token. Refer to the Authentication Guide for details on obtaining and using access tokens.
Authorization: Bearer <your_access_token>Endpoints
Below are the available endpoints for generating and retrieving reports.
1. Get Claim Status Report
Retrieves a detailed report summarizing claims by their current status, including the total number of claims and their aggregated amounts for each status.
Endpoint
GET /api/reports/status (Assumed)
Description
This endpoint provides a list of ClaimReportDTO objects, each representing a summary for a specific claim status. It's useful for understanding the distribution of claims across different processing stages (e.g., "Submitted", "Pending", "Approved", "Rejected", "Processed").
Request
No request body or query parameters are required for this endpoint.
Response Body
A JSON array of ClaimReportDTO objects.
| Field | Type | Description |
| :---------------- | :------ | :------------------------------------------------ |
| claimStatus | String | The status of the claims (e.g., "Pending", "Approved"). |
| totalClaims | Integer | The total count of claims for this status. |
| totalClaimAmount| Double | The sum of claim amounts for all claims with this status. |
Example Response
[
{
"claimStatus": "Submitted",
"totalClaims": 150,
"totalClaimAmount": 150000.75
},
{
"claimStatus": "Pending",
"totalClaims": 75,
"totalClaimAmount": 85000.20
},
{
"claimStatus": "Approved",
"totalClaims": 230,
"totalClaimAmount": 320000.00
},
{
"claimStatus": "Rejected",
"totalClaims": 20,
"totalClaimAmount": 10000.50
},
{
"claimStatus": "Processed",
"totalClaims": 50,
"totalClaimAmount": 60000.00
}
]
2. Get Claims Summary
Retrieves a high-level summary of all claims in the system, typically the most recently generated one.
Endpoint
GET /api/reports/summary (Assumed)
Description
This endpoint returns a single ClaimsSummaryDTO object that provides an overview of the total number of claims and their total aggregated amount across the system, along with the timestamp when this summary was generated. This is useful for quick monitoring of system activity.
Request
No request body or query parameters are required for this endpoint.
Response Body
A JSON object representing a ClaimsSummaryDTO.
| Field | Type | Description |
| :------------------ | :------- | :------------------------------------------------ |
| reportGenerated | String | Timestamp when the summary was last generated (ISO 8601 format). |
| numberOfClaims | Integer | The total number of claims in the system. |
| totalAmount | Double | The grand total of all claim amounts. |
Example Response
{
"reportGenerated": "2023-10-27T10:30:00Z",
"numberOfClaims": 525,
"totalAmount": 625001.45
}
Error Responses
The Reports API uses standard HTTP status codes to indicate the success or failure of an API call.
| Status Code | Description |
| :---------- | :------------------------------------------- |
| 200 OK | The request was successful. |
| 401 Unauthorized | Authentication credentials were missing or invalid. |
| 403 Forbidden | The authenticated user does not have permission to access the resource. |
| 500 Internal Server Error | An unexpected error occurred on the server. |
Example of an error response:
{
"timestamp": "2023-10-27T10:35:15.123Z",
"status": 401,
"error": "Unauthorized",
"message": "Full authentication is required to access this resource",
"path": "/api/reports/status"
}