Appearance
TL API Documentation
API Roadmap
- [ ] Attendance
- [x] Clock In, Clock Out
- [x] Break Start, Break End
- [x] List Attendance
- [x] Get My Attendance
- [x] Get Attendance Status
- [ ] Delete Attendance (Admin)
- [ ] Update Attendance (Admin)
- [ ] Projects
- [x] Create Project
- [x] List Projects
- [x] Update Project
- [x] Delete Project
- [x] Add Project Member
- [x] Remove Project Member
- [x] List Project Members
- [x] List Tasks of a Project
- [ ] Time Reporting
- [x] Create Time Sheet
- [x] Delete Time Sheet
- [x] Get One Time Sheet
- [x] List Time Sheets
- [x] Update Time Sheet
- [ ] Progress Reporting
- [x] Delete Progress Report
- [x] Get One Progress Report
- [x] List Progress Reports
- [x] Save Progress Report
- [x] Send Progress Report
- [x] Send to email via email relaying using SendGrid and Mailjet
- [x] Update One Progress Report
- [x] Also supports updating associated time sheet.
- [ ] Tasks
- [x] Create Task
- [x] List Tasks (basic/not nested)
- [x] List Task grouped by Project of current User (Returns all projects with tasks)
- [ ] Update Task
- [ ] Users
- [x] List Users
- [ ] Authentication
- [ ] V3 Login (Centralized) (Implemented but not yet integrated)
- [ ] Self-Registration (Implemented but not yet integrated)
- [ ] Email Verification (To ensure progress report sender and recipient is a valid email)
- [ ] Send email using Transactional Email Services(Resend, ZeptoMail, Zoho Mail, Cloudflare Email Routing)
- [ ] Email Verification (To ensure progress report sender and recipient is a valid email)
- [ ] User Logging
- [ ] Log login activity
- [ ] Trigger a daily clear of logins to make sure user are always logging in.
- [ ] Log login activity
- [ ] Push notification server
- [ ] Send push notification instead of email for other activities. (To avoid being flagged as spam by email providers and keep on free quota on email services)
Pagination
Time Labor API supports the following pagination methods:
- Offset-based pagination: The default pagination method available in most endpoints.
- Keyset/Cursor-based pagination: Limited only and not available in all endpoints. Technically, a use-case for this is for infinite scrolling.
Offset-based pagination
The returned result will span multiple pages. When listing a resource, you can pass the following query parameters:
| Parameter | Description |
|---|---|
sort | Sort the result. asc or desc value. (default: desc) |
per_page | Number of items to list per page. (default: 5, max: 50) |
page | Page number. (default: 1) |
count | If true it will also include total count of the matched records.[^count] (default: false) |
per_page default value
May vary during development (usually 5 on development). More-likely the default will be changed to 30. This can be changed per instance by changing the constant PAGINATION_MAX_LIMIT on the code.
count parameter
This is sometimes expensive to compute. Use it only when necessary.
In the following example, we list the records with 10 items per page and the first page:
shell
curl --request GET \
--header "Authorization: Bearer <token>" \
"https://timelabor-api.example.com/v2/attendance?per_page=10&page=1"Pagination Response
The response will include the following pagination metadata in the response body.
When a pagination is enabled on the API, the actual data will be wrapped in the result key and the pagination metadata will be included on the top-level response
| Key | Description |
|---|---|
total | Total number of records. This is not included when count is false. |
last_page | Last page number. |
prev_page | Previous page number. null when there is no previous page. |
next_page | Next page number. null when there is no next page. |
has_next_page | true if there is a next page, false otherwise. |
page | Current page number. |
per_page | Number of items per page. |
from | Index of the first item in the current page. |
to | Index of the last item in the current page. |
result | Array of the actual data. |
Example structure of the response:
json
{
"total": 17,
"last_page": 9,
"prev_page": null,
"next_page": 2,
"has_next_page": true,
"page": 1,
"per_page": 2,
"from": 0,
"to": 2,
"result": [
{
"id": "1",
"name": "John Doe"
},
{
"id": "2",
"name": "Jane Doe"
}
]
}