Author: Madhushan Udeshike
Email: madushan.u@arpico.com
Phone: 0112564260
Department: IT
Version: 1.0.0
Create Date: 2025-02-05
This API provides endpoints for retrieving and updating payroll data. It supports both live and sandbox environments. The API uses Digest Authentication for security and requires specific headers for each request.
The API uses Digest Authentication to secure endpoints. Clients must provide valid credentials in the Authorization header.
adminHelloWorld123liveuser apiusertestuser testapiuserAuthorization: Digest username="admin", realm="Protected Area", nonce="...", uri="/v1/endpoint", response="..."
POST /v1/endpointPOST /v1/sandbox/endpoint| Header | Description |
|---|---|
user |
The username of the requester. Must be one of the allowed users. |
created |
Timestamp of the request in Asia/Colombo timezone (e.g., 2025-10-09T12:11:10+05:30). |
{
"code": "S200",
"message": "Success",
"data": [
{
"id": 1,
"name": "Example SBU"
}
]
}
PUT /v1/updatePUT /v1/sandbox/update{
"status": "S200",
"data": [
{
"payrollno": "12345",
"sbucod": "SBU001",
"empno": "EMP001",
"status": "SUCCESS",
"reason": "Processed successfully",
"lockin": 1696156800
}
]
}
{
"code": "S200",
"message": "All records inserted successfully",
"inserted": 1
}
| Code | Description |
|---|---|
E400 |
Invalid request or missing required fields. |
E401 |
Unauthorized user or invalid credentials. |
E403 |
Missing user header. |
E404 |
Missing created header. |
E405 |
Invalid created header format. |
E406 |
Request time is out of bounds (±60 minutes). |
E500 |
Database error. |
S200 |
Success. |
S204 |
No data found. |
S207 |
Partial success (some records failed to insert). |
POST /v1/endpoint HTTP/1.1
Host: localhost:3000
Authorization: Digest username="admin", realm="Protected Area", nonce="...", uri="/v1/endpoint", response="..."
user: liveuser
created: 2023-10-01T12:00:00+05:30
Content-Type: application/json
{
"code": "S200",
"message": "Success",
"data": [
{
"id": 1,
"name": "Example SBU"
}
]
}
PUT /v1/update HTTP/1.1
Host: localhost:3000
Authorization: Digest username="admin", realm="Protected Area", nonce="...", uri="/v1/update", response="..."
user: liveuser
Content-Type: application/json
{
"status": "S200",
"data": [
{
"payrollno": "12345",
"sbucod": "SBU001",
"empno": "EMP001",
"status": "SUCCESS",
"reason": "Processed successfully",
"lockin": 1696156800
}
]
}
{
"code": "S200",
"message": "All records inserted successfully",
"inserted": 1
}
created header must be within ±60 minutes of the server's current time.