Retrieve time entries
Get timecards for one company and pay period, including worked hours and breaks.
Request
GET https://getrightwork.dev/api/store_info/get_time_entries
Send your legacy access token in the Authorization: Token <your-access-token> header.
Query parameters
| Parameter | Type | Description |
|---|---|---|
company_name | String | Name of the company (required) |
pay_period_start_date | String | Start date of the pay period in YYYY-MM-DD format (required) |
Python example
import requests
# Use the access_token returned by the legacy login request.
def call_time_entries_api(company_name, pay_period_start_date, access_token):
url = "https://getrightwork.dev/api/store_info/get_time_entries"
headers = {
"Authorization": f"Token {access_token}",
"Content-Type": "application/json"
}
params = {
"company_name": company_name,
"pay_period_start_date": pay_period_start_date
}
response = requests.get(url, headers=headers, params=params)
if response.status_code == 200:
print("Successfully retrieved time entries")
return response.json()
else:
raise Exception(f"Failed to retrieve time entries: {response.status_code} - {response.text}")
# Example usage:
company_name = "AcmeCorp"
pay_period_start_date = "2024-01-01"
time_entries = call_time_entries_api(company_name, pay_period_start_date, access_token)
print(time_entries)Response
A successful response will return a JSON object with the following fields for each time entry:
| Field | Type | Description |
|---|---|---|
store_id | Integer | ID of the store where the entry was recorded |
store_name | String | Name of the store |
email | String | Employee's email |
first_name | String | Employee's first name |
last_name | String | Employee's last name |
role_name | String | Name of role clocked into |
payroll_external_id | String | Employee’s payroll ID |
timecard_uuid | String | Unique identifier of the timecard |
clocked_in_at | String | Clock-in time in ISO 8601 format |
clocked_out_at | String | Clock-out time in ISO 8601 format |
date | String | Date of the time entry |
duration | Float | Total duration of the shift in hours |
hours_on_break | Float | Hours spent on breaks |
hours_worked | Float | Total hours worked excluding breaks |
status | String | Status of the time entry |
pay_period_start_date | String | Start date of the pay period |
breaks | Array | List of breaks with break_start_at and break_end_at |
