Swaminarayan Gurukul ERP - Seva API (Minimal)
Base URL:
/api/method/swaminarayan_gurukul_erp_app.mobile_api.seva_api
get_task_counts
GET /get_task_counts
Params:
- employee: Employee ID (required)
Example:
GET /get_task_counts?employee=EMP-0001
Response:
{"open_tasks": 5, "overdue_tasks": 2, "completed_tasks": 8}
get_employee_tasks
GET /get_employee_tasks
Params:
- employee: Employee ID
- section_name: open-tasks | overdue-tasks | completed-tasks
- page_start: int (default 0)
- page_length: int (default 5)
Example:
GET /get_employee_tasks?employee=EMP-0001§ion_name=open-tasks&page_start=0&page_length=5
Response:
[{"name": "TASK-001", "subject": "Daily Reporting", "status": "Open"}]
update_task_rsvp
POST /update_task_rsvp
Params:
- task_name: Task ID
- rsvp_value: Yes | No | Maybe
Example:
POST /update_task_rsvp
task_name=TASK-001
Swaminarayan Gurukul ERP - Seva API (Minimal)
rsvp_value=Yes
Response:
{"success": true, "message": "RSVP updated to Yes"}
add_hour_log
POST /add_hour_log
Params:
- task_name: Task ID
- date: YYYY-MM-DD
- hours: float
- notes: optional
Example:
POST /add_hour_log
task_name=TASK-001
date=2025-11-07
hours=2.5
notes=Worked on data entry
Response:
{"success": true}
complete_ongoing
POST /complete_ongoing
Params:
- task_name: Task ID
Example:
POST /complete_ongoing
task_name=TASK-002
Response:
{"success": true, "message": "Ongoing seva completed successfully."}
create_self_task
POST /create_self_task
Params:
Swaminarayan Gurukul ERP - Seva API (Minimal)
- task_data: JSON task object
Example:
POST /create_self_task
task_data={"subject": "Prepare presentation", "priority": "High"}
Response:
{"success": true, "task_id": "TASK-010"}
complete_task_with_hours
POST /complete_task_with_hours
Params:
- task_name: Task ID
- hours_worked: float
Example:
POST /complete_task_with_hours
task_name=TASK-003
hours_worked=4
Response:
{"success": true, "message": "Task completed successfully"}
create_bulk_tasks
POST /create_bulk_tasks
Params:
- parent_task: Parent task name
- employee_ids: List of employee IDs
- task_data: Common task details JSON
Example:
POST /create_bulk_tasks
parent_task=TASK-001
employee_ids=["EMP-001","EMP-002"]
task_data={"subject": "Volunteer Activity"}
Response:
{"success": true, "created_count": 2, "message": "Successfully created 2 sub-tasks"}
Swaminarayan Gurukul ERP - Seva API (Minimal)
get_employees_for_task
GET /get_employees_for_task
Params:
- search_term: Search string (optional)
- status_filter: Filter by status (optional)
- hierarchy_filters: JSON e.g. {"branch": "Ahmedabad"}
- page: int (default 1)
- page_size: int (default 20)
Example:
GET /get_employees_for_task?search_term=Raj&page=1&page_size=10
Response:
{"employees": [{"name": "EMP-001", "employee_name": "Raj Patel"}], "total_count": 25}