Job Sites are preset locations where Work Orders are to be accomplished. Job Sites are broken down to its address parts and have a reverse-geocoded location for their latitude and longitude values.
Fields
| Tag | Data Type | Required | Description |
| accountId | Long | Auto | The id of the Account that owns this record. |
| city | Text | No | The city where the Job Site is located |
| country | Text | No | The country where the Job Site is located |
| deletedAt | Text | No | Indicates the date and time when the Job Site was soft-deleted. Note: Format is in timestamp and timezone (YYYY-MM-DDTHH:MM:SS.sssZ, e.g: 1970-01-01T00:00:00.000Z). This is not returned for Equipment that have not been soft-deleted. |
| fields | Object | No | A collection of custom fields. |
| fullAddress | Character (255) | Yes | Full street address of Job Site |
| id | Auto-incremented Long | Auto | Unique Identifier |
| jobSiteImageId | Long | No | The id of the image associated with this Job Site |
| lastChangedDate | Text | Auto | Auto-generated timestamp of the last change made to this record Note: Format is in timestamp and timezone (YYYY-MM-DDTHH:MM:SS.sssZ, e.g: 1970-01-01T00:00:00.000Z) |
| location | Geometry | No | Latitude and longitude values based on the Job Site’s address |
| name | Character (255) | No | Name of Job Site |
| note | Character (255) | No | Optional text field used for notes/comments about Job Site |
| postalCode | Text | No | The zip or postal code there the Job Site is located |
| state | Text | No | The state where the Job Site is located |
| street | Text | No | The street where the Job Site is located |
Create
| API PATH: | /api/v2/jobSites |
| METHOD: | POST |
| EXAMPLE REQUEST: |
[
{
"fullAddress": "505 N Michigan Ave, Chicago, IL 60611, USA",
"name": "Tower",
"street": "505 North Michigan Avenue",
"city": "Chicago",
"state": "Illinois",
"postalCode": "60611",
"country": "United States",
"location": "POINT (-87.6235815 41.8911622)",
"note": "JS 1",
"jobSiteImageId": 26,
"fields": {}
}
]
|
| EXAMPLE RESPONSE: |
[
{
"fullAddress": "505 N Michigan Ave, Chicago, IL 60611, USA",
"name": "Tower",
"street": "505 North Michigan Avenue",
"city": "Chicago",
"state": "Illinois",
"postalCode": "60611",
"country": "United States",
"location": "POINT (-87.6235815 41.8911622)",
"note": "JS 1",
"jobSiteImageId": 26,
"fields": {},
"accountId": 1248425,
"id": 36907,
"lastChangedDate": "2018-06-11T12:00:00.000Z"
}
]
|
Upload Jobsite Image
| API PATH: | /api/v2/jobSiteImageUpload |
| STEPS: |
1. Enter the ID of the job site you want to upload an image for. |
Read
| API PATH: | /api/v2/jobSites |
| METHOD: | GET |
| PARAMETERS: | from-deleted-at – Retrieves matching records that were deleted after the specified timestamp. Setting to * will return all records. (e.g. from-deleted-at=2018-06-11T12:00:00.000Z, null by default – returns only non-deleted records) from-change-timestamp – Retrieves matching records that were changed after the specified timestamp (e.g. from-change-timestamp=2018-06-11T12:00:00.000Z, all timestamps by default) to-change-timestamp – Retrieves matching records that were changed before the specified timestamp (e.g. to-change-timestamp=2018-06-11T12:00:00.000Z, REQUIRES from-change-timestamp) offset – Retrieves matching records after an offset value (e.g. offset=2, zero offset by default) limit – Retrieves a number of records per page specified by the value (e.g. limit=10, all records by default) |
| SORTING: | sort=id – Sort records by their id field in ascending order (DEFAULT) sort=-id – Sort records by their id field in descending order sort=name – Sort records by their name field in ascending order sort=-name – Sort records by their name field in descending order sort=city – Sort records by their city field in ascending order sort=-city – Sort records by their city field in descending order sort=state – Sort records by their state field in ascending order sort=-state – Sort records by their state field in descending order sort=postal-code – Sort records by their postalCode field in ascending order sort=-postal-code – Sort records by their postalCode field in descending order |
| QUERY STRING EXAMPLES: | Get the Job Site with the specified id: api/v2/jobSites/36907 Get multiple Job Sites by concatenating their ids : /36906+36907 Get two Job Sites of the current Account with an offset of 1 : ?offset=1&limit=2 Get all Job Sites of the current Account sorted by names alphabetically: ?sort=name |
| EXAMPLE RESPONSE: |
[
{
"fullAddress": "505 N Michigan Ave, Chicago, IL 60611, USA",
"name": "Tower",
"street": "505 North Michigan Avenue",
"city": "Chicago",
"state": "Illinois",
"postalCode": "60611",
"country": "United States",
"location": "POINT (-87.6235815 41.8911622)",
"note": "JS 1",
"jobSiteImageId": 26,
"fields": {},
"accountId": 1248425,
"id": 36907,
"lastChangedDate": "2018-06-11T12:00:00.000Z"
}
]
|
View Jobsite Image
| API PATH: | /api/v2/jobSiteImage/id |
| METHOD: | GET |
Update
| API PATH: | /api/v2/jobSites |
| METHOD: | PUT |
| EXAMPLE REQUEST: |
[
{
"fullAddress": "505 N Michigan Ave, Chicago, IL 60611, USA",
"name": "Tower",
"street": "505 North Michigan Avenue",
"city": "Chicago",
"state": "Illinois",
"postalCode": "60611",
"country": "United States",
"location": "POINT (-87.6235815 41.8911622)",
"note": "JS 1 Test",
"jobSiteImageId": 26,
"fields": {},
"id": 36907
}
]
|
| EXAMPLE RESPONSE: |
[
{
"fullAddress": "505 N Michigan Ave, Chicago, IL 60611, USA",
"name": "Tower",
"street": "505 North Michigan Avenue",
"city": "Chicago",
"state": "Illinois",
"postalCode": "60611",
"country": "United States",
"location": "POINT (-87.6235815 41.8911622)",
"note": "JS 1 Test",
"jobSiteImageId": 26,
"fields": {},
"accountId": 1248425,
"id": 36907,
"lastChangedDate": "2018-06-11T12:00:00.000Z"
}
]
|
Delete
| API PATH: | /api/v2/jobSites/<id> |
| METHOD: | DELETE |
| DESCRIPTION: | Supports soft delete. |
API error calls
| ERROR MESSAGE | POSSIBLE CAUSES |
| Access Denied. | POST, PUT and DELETE methods require permission of PERM_EDIT_JOB_SITES |
| Cannot find requested job site. (id = <id>) | PUT error because the Job Site id does not exist. |
| Not a valid image file. Job site icon image must be PNG, JPG, BMP, or GIF | Upload error because of invalid image file. |
| There was an error uploading the job site icon. | Generic error message because of an error while uploading Job Site image. |