How to Retrieve Time Cards in HeavyJob
This guide will detail working with Time Card data using the HeavyJob API.
Prerequisites
Before starting, ensure you have the following:
- Access to HeavyJob APIs.
- An API Client (Client ID and Secret) used to generate an authentication token for API utilization.
- API Client must possess necessary scopes:
heavyjob:readheavyjob:writetimecards:readtimecards:writeheavyjob:users:readheavyjob:users:writeon token generation.
Refer to the Getting Started with Request Tokens guide for details on how to authenticate.
Get a List of Time Card Information
Use the HeavyJob GET All Time Card Info endpoint to acquire a paginated list of time card information.
Purpose: Get a paginated list of time card summary information. You may use the query parameters to filter results of this endpoint.
Response: The response will retreive a list of time card summary information filtered by the query parameters that you set in the request. The id field listed in each record inside of the result array is that timecards ID. This ID is necessary to pull the full details of that time card or to modify it.
This list is paginated, you may have more matching timecards than shown in the initial request. You will need to insert the value inside of the
nextCursorfield into thecursorquery parameter to retreive the next set of results. Keep the query parameters identical when doing this.
There are other time card retrieval endpoints that function similarly to the get all endpoint but serve different purposes.
The HeavyJob GET Timecards with Approvals Endpoint pulls timecards alongside supplementary information surrounding Approvals.
The HeavyJob POST Return Timecards Endpoint allows you to filter timecards using more detailed job and foreman information.
The HeavyJob GET Timecards by Equipment allows you to filter timecards using Equipment information.
Get the full details of a time card using its ID
Use the HeavyJob GET Returns the time card with the specified ID endpoint to acquire the full details of a single timecard.
Purpose: Get details of a single time card using its id.
Response: The response will include a more detailed description of the specific timecard, including costCodes, employees, and equipment.
Updating a Time Card
Use the HeavyJob PUT Update Timecards endpoint to modify an existing timecard.
Purpose: Modify the sentToPayrollRevision and sentToPayRollDateTime field of a single time card using its id. Both fields are required.
Response: The endpoint will send you an HTTP response code indicating the result of your modification request. An HTTP 204 Responses indicates a successful update.
This update endpoint helps you maintain an audit trail with your data.
Use this endpoint after exporting to accounting or payroll systems with fetched timecards.
Your exporting logic should use these fields to determine what timecards need to be re-exported by checking if the current revision is greater than the sentToPayRollRevision.
Supplementary Endpoint
The HeavyJob GET Missing Timecards for Foreman endpoint allows you retrieve foremen with missing time cards within a specified business unit and date range who have previously submitted in the specified date range.
Troubleshooting
If you encounter any issues, please refer to the Getting Started with Request Tokens guide or Contact Us for further assistance.
Updated 10 days ago