Reference
Endpoint List
Authentication & Authorization
| Context | Endpoint | Description |
|---|---|---|
| Register Send OTP | POST /auth/register/otp | Flow 1 Register |
| Register Verify OTP | POST /auth/register/otp/verify | Flow 2 Register |
| Register | POST /auth/register | Flow 3 Register |
| Login | POST /auth/login | |
| Reset Password Send OTP | POST /auth/reset-password/otp | Flow 1 Reset Password |
| Reset Password Verify OTP | POST /auth/reset-password/otp/verify | Flow 2 Reset Password |
| Reset Password | POST /auth/reset-password | Flow 3 Reset Password |
| Refresh Token | POST /auth/refresh-token | |
| Logout | POST /auth/logout |
Profile
| Context | Endpoint | Description |
|---|---|---|
| Get Profile | GET /profiles/{id} | {id}=[me|UUID] |
| Get QR Code | GET /profiles/{id}/qrcode | {id}=[me|UUID] |
| Update Profile | PATCH /profiles/{id} | {id}=[me|UUID] |
| Change Password | PUT /profiles/{id}/password | {id}=[me|UUID] |
| Delete Profile | DELETE /profiles/{id} | {id}=[me|UUID] |
Farm
| Context | Endpoint | Description |
|---|---|---|
| Create Farm | POST /farms | |
| Get Farm | GET /farms | |
| Update Farm | PATCH /farms/{farm_id} | |
| Open Close Farm | POST /farms/{farm_id}/status/toggle |
Farm Worker
| Context | Endpoint | Description |
|---|---|---|
| Invite Worker | POST /farms/{farm_id}/workers | |
| Join Farm | POST /farms/join | |
| Get Workers | GET /farms/{farm_id}/workers | |
| Update Worker Role | PUT /farms/{farm_id}/workers/{worker_id}/roles | |
| Update Worker Status | PATCH /farms/{farm_id}/workers/{worker_id}/status | |
| Remove Worker | DELETE /farms/{farm_id}/workers/{worker_id} | |
| Get Activity Date List | GET /farms/{farm_id}/activities/summary | |
| Get Activity By Date | GET /farms/{farm_id}/activities |
Farm Block
| Context | Endpoint | Description |
|---|---|---|
| Create Block | POST /farms/{farm_id}/blocks | |
| List Blocks | GET /farms/{farm_id}/blocks | |
| Update Block | PATCH /farms/{farm_id}/blocks/{block_id} | |
| Merge Block | POST /farms/{farm_id}/blocks/merge | |
| Delete Block | DELETE /farms/{farm_id}/blocks/{block_id} |
Attendance
| Context | Endpoint | Description |
|---|---|---|
| Create Attendance | POST /farms/{farm_id}/attendances | |
| List Attendance Dates | GET /farms/{farm_id}/attendances/summary | |
| List Attendances | GET /farms/{farm_id}/attendances | |
| Update Attendance | PATCH /farms/{farm_id}/attendances/{attendance_id} | |
| Delete Attendance | DELETE /farms/{farm_id}/attendances/{attendance_id} |
Attendance insertion use worker_code (e.g. ABC-123) and captured_at (converted to UTC).
Firstly, the captured_at will be treated as clock-in time. A control is placed on the database layer in which the clock-in time and worker code are unique and if it duplicates, it will be treated as clock-out time.
Fruit
| Context | Endpoint | Description |
|---|---|---|
| Create Fruit | POST /farms/{farm_id}/fruits | |
| List Fruits | GET /farms/{farm_id}/fruits | |
| Merge Fruits | POST /farms/{farm_id}/fruits/merge | |
| Update Fruit | PATCH /farms/{farm_id}/fruits/{fruit_id} | |
| Delete Fruit | DELETE /farms/{farm_id}/fruits/{fruit_id} |
Session
| Context | Endpoint | Description |
|---|---|---|
| Create Session | POST /farms/{farm_id}/blocks/{block_id}/sessions | |
| List Session Dates | GET /farms/{farm_id}/blocks/{block_id}/sessions/summary | |
| List Sessions | GET /farms/{farm_id}/blocks/{block_id}/sessions | |
| Update Session | PATCH /farms/{farm_id}/blocks/{block_id}/sessions/{session_id} | |
| Delete Session | DELETE /farms/{farm_id}/blocks/{block_id}/sessions/{session_id} |
Last modified on