Projects

Gets a list of projects

sorting

GET /businessUnits/{businessUnitId}/projects?orderBy.fieldId=name%26orderBy.ascending=true

filtering a string field

GET /businessUnits/{businessUnitId}/projects?filters[0].fieldId=name%26filters[0].contains=project

filtering a numeric field

GET /businessUnits/{businessUnitId}/projects?filters[0].fieldId=52fec515-2012-4d2d-b8ae-17c3b274bb84%26filters[0].lowerBound=100

filtering a date field

GET /businessUnits/{businessUnitId}/projects?filters[0].fieldId=8230a513-065b-4928-a64b-57cef4de1a31%26filters[0].lowerBound=2021-01-01T00:00:00.00000Z

paging

GET /businessUnits/{businessUnitId}/projects?continuationToken=continuationToken%26top=100

For help with authorization, see https://developer.hcssapps.com/getting-started/request-tokens

Securitybearer
Request
path Parameters
businessUnitId
required
string or null

The id of the business unit to operate on

query Parameters
Array of objects or null (QueryFilter)

Filters to get a subset of data back. Use array syntax filters[0].fieldId=name filters[0].contains=123

OrderBy.FieldId
string or null

The field id to order by

OrderBy.Ascending
boolean

Whether the data should be sorted in ascending or descending order

ContinuationToken
string or null

The value from the nextPageToken in a previous response. This should be URL encoded.

Top
integer <int32>

The number of items to include. Defaults to 100

Example: Top=100
includeDynamicFields
boolean
Default: true

Flag value to include/exclude runtime dynamic fields like estimates, calculations, etc. By default it is enabled (true). Disabling dynamic fields will improve performance.

Responses
get/api/v1/businessUnits/{businessUnitId}/Projects
Request samples
Response samples
application/json
{
  • "results": [
    ],
  • "nextPageToken": null,
  • "hasNextPage": false
}

Creates a new project

The fields property is dependent on the Project schema. Any missing required fields or incorrectly formatted fields will result in a 400.

For help with authorization, see https://developer.hcssapps.com/getting-started/request-tokens

Securitybearer
Request
path Parameters
businessUnitId
required
string
Request Body schema: application/json

The new project to create. Must contain a fields property with any required fields specified in the project schema for the current business unit.

id
string or null

Optional - The unique Id of the project.

required
object

An object containing values that correspond to the Projects schema fields. Keyed by schemafield.id.

object or null

An object containing metadata of fields. Key by field id.

locationId
string or null

Optional - The Location Id (HeavyJob) that is linked to the project.

Responses
post/api/v1/businessUnits/{businessUnitId}/Projects
Request samples
application/json
{
  • "id": "c33d6196-ecae-4bca-8d90-93f6951ba9b6",
  • "fields": {
    },
  • "fieldsMetadata": {
    },
  • "locationId": "65f43597-43dd-4380-8930-91e0045f8aa8"
}
Response samples
application/json
{
  • "id": "c33d6196-ecae-4bca-8d90-93f6951ba9b6",
  • "lastModifiedByUserId": "17f96543-9898-4be2-b6c7-e6723bbb1389",
  • "lastModifiedByClientId": "string",
  • "lastModifiedBySystemUser": true,
  • "dateCreated": "2022-01-01T12:01:48.000Z",
  • "lastModified": "2022-01-01T12:01:48.000Z",
  • "deleted": false,
  • "businessUnitId": "308e83a3-59bf-4422-9803-a98120b51770",
  • "fields": {
    },
  • "fieldsMetadata": {
    },
  • "locationId": "65f43597-43dd-4380-8930-91e0045f8aa8",
  • "warnings": [
    ]
}

Gets a specific project

Securitybearer
Request
path Parameters
id
required
string or null

The project id to get

businessUnitId
required
string
query Parameters
includeDynamicFields
boolean
Default: true

Flag value to include/exclude runtime dynamic fields like estimates, calculations, etc. By default it is enabled (true). Disabling dynamic fields will improve performance.

Responses
get/api/v1/businessUnits/{businessUnitId}/Projects/{id}
Request samples
Response samples
application/json
{
  • "id": "c33d6196-ecae-4bca-8d90-93f6951ba9b6",
  • "lastModifiedByUserId": "17f96543-9898-4be2-b6c7-e6723bbb1389",
  • "lastModifiedByClientId": "string",
  • "lastModifiedBySystemUser": true,
  • "dateCreated": "2022-01-01T12:01:48.000Z",
  • "lastModified": "2022-01-01T12:01:48.000Z",
  • "deleted": false,
  • "businessUnitId": "308e83a3-59bf-4422-9803-a98120b51770",
  • "fields": {
    },
  • "fieldsMetadata": {
    },
  • "locationId": "65f43597-43dd-4380-8930-91e0045f8aa8"
}

Replaces the project

This will replace the existing project with whatever is passed in the request body. Any missing values in the request body will be erased. For partial updates look at the Patch method

For help with authorization, see https://developer.hcssapps.com/getting-started/request-tokens

Securitybearer
Request
path Parameters
id
required
string or null

The project id to update

businessUnitId
required
string
Request Body schema: application/json

The new project to replace the old one with

id
string or null

Optional - The unique Id of the project.

required
object

An object containing values that correspond to the Projects schema fields. Keyed by schemafield.id.

object or null

An object containing metadata of fields. Key by field id.

locationId
string or null

Optional - The Location Id (HeavyJob) that is linked to the project.

Responses
put/api/v1/businessUnits/{businessUnitId}/Projects/{id}
Request samples
application/json
{
  • "id": "c33d6196-ecae-4bca-8d90-93f6951ba9b6",
  • "fields": {
    },
  • "fieldsMetadata": {
    },
  • "locationId": "65f43597-43dd-4380-8930-91e0045f8aa8"
}
Response samples
application/json
{
  • "id": "c33d6196-ecae-4bca-8d90-93f6951ba9b6",
  • "lastModifiedByUserId": "17f96543-9898-4be2-b6c7-e6723bbb1389",
  • "lastModifiedByClientId": "string",
  • "lastModifiedBySystemUser": true,
  • "dateCreated": "2022-01-01T12:01:48.000Z",
  • "lastModified": "2022-01-01T12:01:48.000Z",
  • "deleted": false,
  • "businessUnitId": "308e83a3-59bf-4422-9803-a98120b51770",
  • "fields": {
    },
  • "fieldsMetadata": {
    },
  • "locationId": "65f43597-43dd-4380-8930-91e0045f8aa8",
  • "warnings": [
    ]
}

Applies a partial change to the project

This is a PARTIAL implementation of the JsonPatch protocol - See https://tools.ietf.org/html/rfc6902 for more information.

Setting an object property within an array is NOT supported (e.g. "path": "fields/estimates/2/selectedEstimate")

Instead, use a replace on the full array element (e.g. "path": "fields/estimates/2")

Examples of valid operations:

Replace a string:

PATCH /businessUnits/{businessUnitId}/projects/{id}
[
   {
      "path": "fields/name",
      "op": "add",
      "value": "New Project Name"
   }
]
        

Replace an entire array:

PATCH /businessUnits/{businessUnitId}/projects/{id}
[
   {
      "path": "fields/bidResults",
      "op": "add",
      "value": [{"name": "Competitor 1", "amount": 38204, "winner": true}]
   }
]
        

Add an element to end of array:

PATCH /businessUnits/{businessUnitId}/projects/{id}
[
   {
      "path": "fields/bidResults/-",
      "op": "add",
      "value": {"name": "Competitor 1", "amount": 38204, "winner": true}
   }
]
        

Replace the first element in an array:

PATCH /businessUnits/{businessUnitId}/projects/{id}
[
   {
      "path": "fields/bidResults/0",
      "op": "replace",
      "value": {"name": "Competitor 1", "amount": 38204, "winner": true}
   }
]
        

For help with authorization, see https://developer.hcssapps.com/getting-started/request-tokens

Securitybearer
Request
path Parameters
id
required
string or null

The id of the project to patch

businessUnitId
required
string
Request Body schema: application/json

The changes to be applied to the project

Array
path
string or null
op
string or null
from
string or null
value
any or null
Responses
patch/api/v1/businessUnits/{businessUnitId}/Projects/{id}
Request samples
application/json
[
  • {
    }
]
Response samples
application/json
{
  • "id": "c33d6196-ecae-4bca-8d90-93f6951ba9b6",
  • "lastModifiedByUserId": "17f96543-9898-4be2-b6c7-e6723bbb1389",
  • "lastModifiedByClientId": "string",
  • "lastModifiedBySystemUser": true,
  • "dateCreated": "2022-01-01T12:01:48.000Z",
  • "lastModified": "2022-01-01T12:01:48.000Z",
  • "deleted": false,
  • "businessUnitId": "308e83a3-59bf-4422-9803-a98120b51770",
  • "fields": {
    },
  • "fieldsMetadata": {
    },
  • "locationId": "65f43597-43dd-4380-8930-91e0045f8aa8",
  • "warnings": [
    ]
}

Delete a project by id

Securitybearer
Request
path Parameters
id
required
string or null

The project id to delete

businessUnitId
required
string or null

The id of the business unit to operate on

Responses
204

Empty response indicating that the delete was successful

delete/api/v1/businessUnits/{businessUnitId}/Projects/{id}
Request samples

Creates multiple projects

Similar to the POST and PUT endpoints, but allows for multiple projects to be created or updated in a single request. See POST for more information.

For help with authorization, see https://developer.hcssapps.com/getting-started/request-tokens

Securitybearer
Request
path Parameters
businessUnitId
required
string
query Parameters
skipInvalidFields
boolean
Default: false

Specify if invalid projects should be saved without invalid fields otherwise invalid projects will not be saved

Request Body schema: application/json

an array of projects to create

Array
id
string or null

Optional - The unique Id of the project.

required
object

An object containing values that correspond to the Projects schema fields. Keyed by schemafield.id.

object or null

An object containing metadata of fields. Key by field id.

locationId
string or null

Optional - The Location Id (HeavyJob) that is linked to the project.

Responses
post/api/v1/businessUnits/{businessUnitId}/Projects/range
Request samples
application/json
[
  • {
    }
]
Response samples
application/json
{
  • "success": [
    ],
  • "failed": [
    ],
  • "invalid": [
    ]
}

Projects_DeleteMultiple

Securitybearer
Request
path Parameters
businessUnitId
required
string or null
Request Body schema: application/json
Array
string
Responses
delete/api/v1/businessUnits/{businessUnitId}/Projects/range
Request samples
application/json
[
  • "string"
]
Response samples
application/json
{
  • "success": [
    ],
  • "failed": [
    ]
}