Introduction
Welcome to PayrollPro.PH API reference.
To start using these APIs, you need to contact the payrollpro.ph support team to get your client credentials.
Billable Hours
The billable hours REST APIs enable you to access billable hours information.
These APIs provide the ability to:
- Retrieve a collection of billable hours entry.
- Retrieve a billable hours entry with the specified ID.
GET /billable
Retrieves a collection of billable hours entry. You can filter by payroll date.
Example request:
import requests
import json
url = 'http://localhost/api/v1/billable'
payload = {
'payrollDate': '2023-08-31'
}
headers = {
'Authorization': 'Bearer {token}',
'Content-Type': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()
$client = new \GuzzleHttp\Client();
$response = $client->get("http://localhost/api/v1/billable", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"payrollDate" => "2023-08-31",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL("http://localhost/api/v1/billable");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"payrollDate": "2023-08-31"
}
fetch(url, {
method: "GET",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"employeeId": "PP-20230001",
"departmentName": "Business Development",
"costCenter": "",
"project": "",
"attendanceDate": "2023-08-07",
"noOfHours": "8.00",
"comment": "Default billable",
"category": "Billable"
},
{
"employeeId": "PP-20230008",
"departmentName": "Information Technology",
"costCenter": "",
"project": "",
"attendanceDate": "2023-08-07",
"noOfHours": "8.00",
"comment": "Default billable",
"category": "Billable"
},
{
"employeeId": "PP-20230009",
"departmentName": "Human Resources",
"costCenter": "",
"project": "",
"attendanceDate": "2023-08-07",
"noOfHours": "8.00",
"comment": "Default billable",
"category": "Billable"
}
]
}
Example response (401):
{
"error": "Unauthenticated."
}
HTTP Request
GET api/v1/billable
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
payrollDate | string | required | Payroll date using the yyyy-mm-dd format. |
GET /billable/{billable}
Retrieves a billable hours entry with the specified ID.
Example request:
import requests
import json
url = 'http://localhost/api/v1/billable/1'
headers = {
'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
$client = new \GuzzleHttp\Client();
$response = $client->get("http://localhost/api/v1/billable/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL("http://localhost/api/v1/billable/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": {
"employeeId": "PP-20230001",
"departmentName": "Business Development",
"costCenter": "",
"project": "",
"attendanceDate": "2023-08-07",
"noOfHours": "8.00",
"comment": "Default billable",
"category": "Billable"
}
}
Example response (401):
{
"error": "Unauthenticated."
}
HTTP Request
GET api/v1/billable/{billable}
Daily Attendance
The daily attendance REST APIs enable you to access daily attendance information.
These APIs provide the ability to:
- Retrieve a collection of daily attendance.
- Retrieve a daily attendance with the specified ID.
GET /attendance
Retrieves a collection of daily attendance. You can filter by payroll date.
Example request:
import requests
import json
url = 'http://localhost/api/v1/attendance'
payload = {
'payrollDate': '2023-08-31'
}
headers = {
'Authorization': 'Bearer {token}',
'Content-Type': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()
$client = new \GuzzleHttp\Client();
$response = $client->get("http://localhost/api/v1/attendance", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"payrollDate" => "2023-08-31",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL("http://localhost/api/v1/attendance");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"payrollDate": "2023-08-31"
}
fetch(url, {
method: "GET",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"employeeId": "PP-20230001",
"departmentName": "Business Development",
"attendanceDate": "2023-08-07",
"dayStatus": "Work Day",
"leaveType": "",
"holidayType": "",
"holidayName": "",
"shiftType": "Regular",
"shift": "2023-08-07T06:00:00+08:00 to 2023-08-07T15:00:00+08:00",
"timeIn": "2023-08-07T05:48:00+08:00",
"timeOut": "2023-08-07T18:02:00+08:00",
"requiredHours": "8.00",
"hoursWorked": "12.23",
"late": "0.00",
"loggedUt": "0.00",
"loggedOt": "4.23",
"nightDiff": "0.00"
},
{
"employeeId": "PP-20230008",
"departmentName": "Information Technology",
"attendanceDate": "2023-08-07",
"dayStatus": "Work Day",
"leaveType": "",
"holidayType": "",
"holidayName": "",
"shiftType": "Regular",
"shift": "2023-08-07T09:00:00+08:00 to 2023-08-07T18:00:00+08:00",
"timeIn": "2023-08-07T09:34:00+08:00",
"timeOut": "2023-08-07T18:51:00+08:00",
"requiredHours": "8.00",
"hoursWorked": "9.28",
"late": "0.57",
"loggedUt": "0.00",
"loggedOt": "1.28",
"nightDiff": "0.00"
},
{
"employeeId": "PP-20230009",
"departmentName": "Human Resources",
"attendanceDate": "2023-08-07",
"dayStatus": "Work Day",
"leaveType": "",
"holidayType": "",
"holidayName": "",
"shiftType": "Regular",
"shift": "2023-08-07T09:00:00+08:00 to 2023-08-07T18:00:00+08:00",
"timeIn": "2023-08-07T09:05:00+08:00",
"timeOut": "2023-08-07T18:07:00+08:00",
"requiredHours": "8.00",
"hoursWorked": "9.03",
"late": "0.00",
"loggedUt": "0.00",
"loggedOt": "1.03",
"nightDiff": "0.00"
}
]
}
Example response (401):
{
"error": "Unauthenticated."
}
HTTP Request
GET api/v1/attendance
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
payrollDate | string | required | Payroll date using the yyyy-mm-dd format. |
GET /attendance/{attendance}
Retrieves a daily attendance with the specified ID.
Example request:
import requests
import json
url = 'http://localhost/api/v1/attendance/1'
headers = {
'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
$client = new \GuzzleHttp\Client();
$response = $client->get("http://localhost/api/v1/attendance/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL("http://localhost/api/v1/attendance/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": {
"employeeId": "PP-20230001",
"departmentName": "Business Development",
"attendanceDate": "2023-08-07",
"holidayType": "",
"holidayName": "",
"shiftType": "Regular",
"shift": "2023-08-07T06:00:00+08:00 to 2023-08-07T15:00:00+08:00",
"timeIn": "2023-08-07T05:48:00+08:00",
"timeOut": "2023-08-07T18:02:00+08:00",
"requiredHours": "8.00",
"hoursWorked": "12.23",
"late": "0.00",
"loggedUt": "0.00",
"loggedOt": "4.23",
"nightDiff": "0.00"
}
}
Example response (401):
{
"error": "Unauthenticated."
}
HTTP Request
GET api/v1/attendance/{attendance}
Leave
The leave REST APIs enable you to access leave information.
These APIs provide the ability to:
- Retrieve a collection of leave application.
- Retrieve a leave application with the specified ID.
GET /leave
Retrieves a collection of leave application. You can filter by payroll date.
Example request:
import requests
import json
url = 'http://localhost/api/v1/leave'
payload = {
'payrollDate': '2023-08-31'
}
headers = {
'Authorization': 'Bearer {token}',
'Content-Type': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()
$client = new \GuzzleHttp\Client();
$response = $client->get("http://localhost/api/v1/leave", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"payrollDate" => "2023-08-31",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL("http://localhost/api/v1/leave");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"payrollDate": "2023-08-31"
}
fetch(url, {
method: "GET",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"employeeId": "PP-20230018",
"departmentName": "Marketing",
"leaveType": "Sick Leave",
"transactionType": "Usage",
"attendanceDate": "2023-08-15",
"noOfDays": "1.00",
"noOfHours": "8.00",
"reason": "Fever",
"status": "Approved"
},
{
"employeeId": "PP-20230018",
"departmentName": "Marketing",
"leaveType": "Sick Leave",
"transactionType": "Usage",
"attendanceDate": "2023-08-16",
"noOfDays": "1.00",
"noOfHours": "8.00",
"reason": "Fever",
"status": "Approved"
},
{
"employeeId": "PP-20230021",
"departmentName": "Accounting",
"leaveType": "Vacation Leave",
"transactionType": "Usage",
"attendanceDate": "2023-08-18",
"noOfDays": "1.00",
"noOfHours": "8.00",
"reason": "Family outing",
"status": "Awaiting approval"
}
]
}
Example response (401):
{
"error": "Unauthenticated."
}
HTTP Request
GET api/v1/leave
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
payrollDate | string | required | Payroll date using the yyyy-mm-dd format. |
GET /leave/{leave}
Retrieves a leave application with the specified ID.
Example request:
import requests
import json
url = 'http://localhost/api/v1/leave/1'
headers = {
'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
$client = new \GuzzleHttp\Client();
$response = $client->get("http://localhost/api/v1/leave/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL("http://localhost/api/v1/leave/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": {
"employeeId": "PP-20230018",
"departmentName": "Marketing",
"leaveType": "Sick Leave",
"transactionType": "Usage",
"attendanceDate": "2023-08-15",
"noOfDays": "1.00",
"noOfHours": "8.00",
"reason": "Fever",
"status": "Approved"
}
}
Example response (401):
{
"error": "Unauthenticated."
}
HTTP Request
GET api/v1/leave/{leave}
Overtime
The overtime REST APIs enable you to access overtime information.
These APIs provide the ability to:
- Retrieve a collection of overtime application.
- Retrieve a overtime application with the specified ID.
GET /overtime
Retrieves a collection of overtime application. You can filter by payroll date.
Example request:
import requests
import json
url = 'http://localhost/api/v1/overtime'
payload = {
'payrollDate': '2023-08-31'
}
headers = {
'Authorization': 'Bearer {token}',
'Content-Type': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()
$client = new \GuzzleHttp\Client();
$response = $client->get("http://localhost/api/v1/overtime", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"payrollDate" => "2023-08-31",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL("http://localhost/api/v1/overtime");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"payrollDate": "2023-08-31"
}
fetch(url, {
method: "GET",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"employeeId": "PP-20230001",
"departmentName": "Business Development",
"dateFiled": "2023-08-08",
"attendanceDate": "2023-08-07",
"type": "Regular",
"logged": "4.23",
"applied": "4.00",
"approved": "4.00",
"nightDifferentialOvertime": "0.00",
"reason": "Meeting with client, processed payroll",
"status": "Approved",
"dateApproved": "2023-08-10",
"payrollDate": "2023-08-31"
},
{
"employeeId": "PP-20230008",
"departmentName": "Information Technology",
"dateFiled": "2023-08-07",
"attendanceDate": "2023-08-07",
"type": "Regular",
"logged": "1.28",
"applied": "1.00",
"approved": "1.00",
"nightDifferentialOvertime": "0.00",
"reason": "Fix system bug",
"status": "Approved",
"dateApproved": "2023-08-09",
"payrollDate": "2023-08-31"
},
{
"employeeId": "PP-20230009",
"departmentName": "Human Resources",
"dateFiled": "2023-08-07",
"attendanceDate": "2023-08-07",
"type": "Regular",
"logged": "1.03",
"applied": "1.00",
"approved": "1.00",
"nightDifferentialOvertime": "0.00",
"reason": "Payroll inputs review",
"status": "Approved",
"dateApproved": "2023-08-08",
"payrollDate": "2023-08-31"
}
]
}
Example response (401):
{
"error": "Unauthenticated."
}
HTTP Request
GET api/v1/overtime
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
payrollDate | string | required | Payroll date using the yyyy-mm-dd format. |
GET /overtime/{overtime}
Retrieves a overtime application with the specified ID.
Example request:
import requests
import json
url = 'http://localhost/api/v1/overtime/1'
headers = {
'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
$client = new \GuzzleHttp\Client();
$response = $client->get("http://localhost/api/v1/overtime/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL("http://localhost/api/v1/overtime/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": {
"employeeId": "PP-20230001",
"departmentName": "Business Development",
"dateFiled": "2023-08-08",
"attendanceDate": "2023-08-07",
"type": "Regular",
"logged": "4.23",
"applied": "4.00",
"approved": "4.00",
"nightDifferentialOvertime": "0.00",
"reason": "Meeting with client, processed payroll",
"status": "Approved",
"dateApproved": "2023-08-10",
"payrollDate": "2023-08-31"
}
}
Example response (401):
{
"error": "Unauthenticated."
}
HTTP Request
GET api/v1/overtime/{overtime}
Time Log
The time log REST APIs enable you to access time logs information.
These APIs provide the ability to:
- Retrieve a collection of time logs.
- Add a time log for the specified employee ID.
- Retrieve a time log with the specified ID.
- Update the time log for the specified ID.
GET /timelogs
Retrieves a collection of time logs. You can filter by payroll date.
Example request:
import requests
import json
url = 'http://localhost/api/v1/timelogs'
payload = {
'payrollDate': '2023-08-31'
}
headers = {
'Authorization': 'Bearer {token}',
'Content-Type': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()
$client = new \GuzzleHttp\Client();
$response = $client->get("http://localhost/api/v1/timelogs", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"payrollDate" => "2023-08-31",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL("http://localhost/api/v1/timelogs");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"payrollDate": "2023-08-31"
}
fetch(url, {
method: "GET",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"employeeId": "PP-20230001",
"departmentName": "Business Development",
"attendanceDate": "2023-08-07",
"timeIn": "2023-08-07T05:48:00+08:00",
"timeOut": "2023-08-07T18:02:00+08:00"
},
{
"employeeId": "PP-20230008",
"departmentName": "Information Technology",
"attendanceDate": "2023-08-07",
"timeIn": "2023-08-07T09:34:00+08:00",
"timeOut": "2023-08-07T18:51:00+08:00"
},
{
"employeeId": "PP-20230009",
"departmentName": "Human Resources",
"attendanceDate": "2023-08-07",
"timeIn": "2023-08-07T09:05:00+08:00",
"timeOut": "2023-08-07T18:07:00+08:00"
}
]
}
Example response (401):
{
"error": "Unauthenticated."
}
HTTP Request
GET api/v1/timelogs
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
payrollDate | string | required | Payroll date using the yyyy-mm-dd format. |
POST /timelogs
Adds a time log with the specified data in the request body.
Example request:
import requests
import json
url = 'http://localhost/api/v1/timelogs'
payload = {
'employeeId': 'PP-20230001',
'attendanceDate': '2023-08-07',
'timeIn': '2023-08-07 05:48:00',
'timeOut': '2023-08-07 18:02:00'
}
headers = {
'Authorization': 'Bearer {token}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
$client = new \GuzzleHttp\Client();
$response = $client->post("http://localhost/api/v1/timelogs", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"employeeId" => "PP-20230001",
"attendanceDate" => "2023-08-07",
"timeIn" => "2023-08-07 05:48:00",
"timeOut" => "2023-08-07 18:02:00",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL("http://localhost/api/v1/timelogs");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"employeeId": "PP-20230001",
"attendanceDate": "2023-08-07",
"timeIn": "2023-08-07 05:48:00",
"timeOut": "2023-08-07 18:02:00"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": {
"employeeId": "PP-20230001",
"departmentName": "Business Development",
"attendanceDate": "2023-08-07",
"timeIn": "2023-08-07T05:48:00+08:00",
"timeOut": "2023-08-07T18:02:00+08:00"
}
}
HTTP Request
POST api/v1/timelogs
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
employeeId | string | required | ID of the employee. |
attendanceDate | string | required | Date of the attendance. |
timeIn | string | required | Start time of the attendance. |
timeOut | string | required | End time of the attendance. |
GET /timelogs/{timelog}
Retrieves a time log with the specified ID.
Example request:
import requests
import json
url = 'http://localhost/api/v1/timelogs/1'
headers = {
'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
$client = new \GuzzleHttp\Client();
$response = $client->get("http://localhost/api/v1/timelogs/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL("http://localhost/api/v1/timelogs/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": {
"employeeId": "PP-20230001",
"departmentName": "Business Development",
"attendanceDate": "2023-08-07",
"timeIn": "2023-08-07T05:48:00+08:00",
"timeOut": "2023-08-07T18:02:00+08:00"
}
}
Example response (401):
{
"error": "Unauthenticated."
}
HTTP Request
GET api/v1/timelogs/{timelog}
PUT /timelogs/{timelog}
Updates the time log for the specified ID. Update the existing time log with the specified data in the request body.
Example request:
import requests
import json
url = 'http://localhost/api/v1/timelogs/1'
payload = {
'timeIn': '2023-08-07 05:15:00',
'timeOut': '2023-08-07 14:30:00'
}
headers = {
'Authorization': 'Bearer {token}',
'Content-Type': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
$client = new \GuzzleHttp\Client();
$response = $client->put("http://localhost/api/v1/timelogs/1", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"timeIn" => "2023-08-07 05:15:00",
"timeOut" => "2023-08-07 14:30:00",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL("http://localhost/api/v1/timelogs/1");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"timeIn": "2023-08-07 05:15:00",
"timeOut": "2023-08-07 14:30:00"
}
fetch(url, {
method: "PUT",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": {
"employeeId": "PP-20230001",
"departmentName": "Business Development",
"attendanceDate": "2023-08-07",
"timeIn": "2023-08-07T05:15:00+08:00",
"timeOut": "2023-08-07T14:30:00+08:00"
}
}
HTTP Request
PUT api/v1/timelogs/{timelog}
PATCH api/v1/timelogs/{timelog}
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
timeIn | string | required | Start time of the attendance. |
timeOut | string | required | End time of the attendance. |
Time Tracker
The time tracker REST APIs enable you to access time tracker information.
These APIs provide the ability to:
- Retrieve a collection of time tracker.
- Retrieve a time tracker with the specified ID.
GET /timetracker
Retrieves a collection of time tracker. You can filter by payroll date.
Example request:
import requests
import json
url = 'http://localhost/api/v1/timetracker'
payload = {
'payrollDate': '2023-08-31'
}
headers = {
'Authorization': 'Bearer {token}',
'Content-Type': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()
$client = new \GuzzleHttp\Client();
$response = $client->get("http://localhost/api/v1/timetracker", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"payrollDate" => "2023-08-31",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL("http://localhost/api/v1/timetracker");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"payrollDate": "2023-08-31"
}
fetch(url, {
method: "GET",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"employeeId": "PP-20230001",
"departmentName": "Business Development",
"attendanceDate": "2023-08-07",
"startTime": "2023-08-07T05:48:00+08:00",
"endTime": "2023-08-07T18:02:00+08:00",
"duration": "12.23",
"remarks": "Payroll day",
"startDevice": "WebKit \/ Windows 10.0 \/ Chrome 98.0.4758.82",
"endDevice": "WebKit \/ Windows 10.0 \/ Chrome 98.0.4758.82"
},
{
"employeeId": "PP-20230008",
"departmentName": "Information Technology",
"attendanceDate": "2023-08-07",
"startTime": "2023-08-07T09:34:00+08:00",
"endTime": "2023-08-07T18:51:00+08:00",
"duration": "9.28",
"remarks": "App development",
"startDevice": "Macintosh \/ OS X 10.15.7 \/ Chrome 92.0.4515.131",
"endDevice": "Macintosh \/ OS X 10.15.7 \/ Chrome 92.0.4515.131"
},
{
"employeeId": "PP-20230009",
"departmentName": "Human Resources",
"attendanceDate": "2023-08-07",
"startTime": "2023-08-07T09:05:00+08:00",
"endTime": "2023-08-07T18:07:00+08:00",
"duration": "9.03",
"remarks": "Client meeting, Onboarding, Support",
"startDevice": "WebKit \/ Windows 10.0 \/ Edge 103.0.1264.77",
"endDevice": "WebKit \/ Windows 10.0 \/ Edge 103.0.1264.77"
}
]
}
Example response (401):
{
"error": "Unauthenticated."
}
HTTP Request
GET api/v1/timetracker
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
payrollDate | string | required | Payroll date using the yyyy-mm-dd format. |
GET /timetracker/{timetracker}
Retrieves a time tracker with the specified ID.
Example request:
import requests
import json
url = 'http://localhost/api/v1/timetracker/1'
headers = {
'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
$client = new \GuzzleHttp\Client();
$response = $client->get("http://localhost/api/v1/timetracker/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL("http://localhost/api/v1/timetracker/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": {
"employeeId": "PP-20230001",
"departmentName": "Business Development",
"attendanceDate": "2023-08-07",
"startTime": "2023-08-07T05:48:00+08:00",
"endTime": "2023-08-07T18:02:00+08:00",
"duration": "12.23",
"remarks": "Payroll day",
"startDevice": "WebKit \/ Windows 10.0 \/ Chrome 98.0.4758.82",
"endDevice": "WebKit \/ Windows 10.0 \/ Chrome 98.0.4758.82"
}
}
Example response (401):
{
"error": "Unauthenticated."
}
HTTP Request
GET api/v1/timetracker/{timetracker}