Add Leave Application
POST/api/leave-applications
Headers
| Field | Type | Description |
|---|---|---|
| authtoken | String | Authentication token, generated from admin area |
Parameters
| Field | Type | Description |
|---|---|---|
| leave_type_id | number | Mandatory Leave type ID |
| applicant_id | number | Mandatory Applicant user ID |
| start_date | string | Mandatory Start date (Y-m-d) |
| end_date | string | Mandatory End date (Y-m-d) |
| reason | string | Mandatory Leave reason |
| total_days | number | optional Optional Total days (auto-calculated if not provided) |
curl -X POST "https://yoursite.com/api/leave-applications" \
-H "authtoken: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "leave_type_id": "...", "applicant_id": "...", "start_date": "...", "end_date": "...", "reason": "..." }' Success-Response:
HTTP/1.1 201 Created
{
"status": 200,
"messages": {"success": "Leave application add success"},
"id": 1
}