How to save an attachment in HeavyJob
This tutorial will walk you through how to save an attachment in HeavyJob. These files are used in several places, including the Daily Digest and Photos & Docs tool.
Prerequisites
Files in HeavyJob are organized by the businessUnitId, jobId, foremanId, and transactionDate values. You will need all four values to save a file in HeavyJob.
You may use the following three endpoints to acquire the businessUnitId, jobId, foremanId values. You will create the transactionDate value yourself. The expected date format is listed further on in this section.
BusinessUnitId
You can acquire a BusinessUnitId from the HeavyJob get business units endpoint.
JobId
You can acquire a JobId from the HeavyJob get jobs endpoints.
ForemanId
You can acquire a ForemanId from the HeavyJob get employees in a business unit endpoint.
TransactionDate
You will create this value in the request body.
The expected date format is "Year-Month-Day", an example is provided below.
"transactionDate": "2025-03-24"
Step 1: Upload the File Using the Attachments API
The Attachments API is used to upload, store, download, and share files across HCSS products.
To upload a file, make a POST request to the Attachments API Files endpoint.
warning
You must provide the BusinessUnitID, JobID, and upload a file.
attention
The fileId value you need for the next step will be given in the response of this request. Please keep it ready.
Step 2: Link the Uploaded File to HeavyJob
Files are saved in HeavyJob by associating the file to a foreman for a given date and job. This is done by sending a POST request to the HeavyJob attachment endpoint.
You must fill in the transactionDate, jobId, foremanId fields in the request body using the values derived from the prerequisite section.
The fileId field should be filled in with the value given by the step1 response.
You may optionally include a note for each attachment, to help users understand the origin or context of the file.
A successful association will return a 201 Created response.