Rightwork OG Image
Browse API documentation
API docsLegacy API

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

ParameterTypeDescription
company_nameStringName of the company (required)
pay_period_start_dateStringStart date of the pay period in YYYY-MM-DD format (required)

Python example

Python
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:

FieldTypeDescription
store_idIntegerID of the store where the entry was recorded
store_nameStringName of the store
emailStringEmployee's email
first_nameStringEmployee's first name
last_nameStringEmployee's last name
role_nameStringName of role clocked into
payroll_external_idStringEmployee’s payroll ID
timecard_uuidStringUnique identifier of the timecard
clocked_in_atStringClock-in time in ISO 8601 format
clocked_out_atStringClock-out time in ISO 8601 format
dateStringDate of the time entry
durationFloatTotal duration of the shift in hours
hours_on_breakFloatHours spent on breaks
hours_workedFloatTotal hours worked excluding breaks
statusStringStatus of the time entry
pay_period_start_dateStringStart date of the pay period
breaksArrayList of breaks with break_start_at and break_end_at