Added
Get timesheet segments
6 days ago by Barima Kwarteng
You can now fetch the segments of a timesheet through the Public API: the clock-in, driving, idle, on-site and on-break periods, and the clock-out, that make up a shift recorded with Segmented Tracking.
GET https://api.timeero.app/api/public/segments/{timesheetId}What you get
- A summary of the shift: clock-in and clock-out times, total duration, break time, and driving distance.
- Every segment in order, with its category, local start and end times, duration, address or site, and, for driving segments, the distance in kilometers and miles.
- Breaks taken inside each segment.
How it works
- Segments for clocked-out timesheets are usually ready, and are returned straight away with
200. - If they haven't been generated yet, the API starts generating them and returns
202. Repeat the same request after a few seconds until you get200. - Each company generates segments for one timesheet at a time. A request for a different timesheet while one is in progress returns
429; retry it shortly.
Requirements
- Your company needs the Segmented Tracking add-on. Without it, the endpoint returns
422. - The timesheet must be clocked out. Timesheets still in progress return
422.
See the Timesheet segments guide for the full flow, and the API reference for every field and status code.