POST /jobs |
This service is used to create a new job or to update one or more existing jobs.
For any Job object:
A unit is assigned to the job’s route (routeId) | A unit is not assigned to the job’s route | |
---|---|---|
The authenticated driver is assigned to a unit (unitId) | The route’s unit assignment does not change. | The driver’s unit is automatically assigned to the job’s route. |
The authenticated driver is not assigned to a unit | The route’s unit assignment does not change. | The route’s unit assignment remains unassigned. |
The Request body is a JSON array of job objects describing the jobs to create or update.
Member | Type | Purpose | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | string | (read-only) Uniquely identifies the job. This is an alphanumeric identifier. | |||||||||||||||||||||||||||
status | string | Indicates the current status of the job. Values: Rejected (driver rejected the job), Todo (job is on route but not yet reached), EnRoute (previous job done but not yet reached next), OnSite (driver is at job), Completed. This field can be updated through the API. If not specified, this field defaults to Todo. |
|||||||||||||||||||||||||||
address | Address | The address and location of the Job site, where the driver must go in order to perform a job:
|
|||||||||||||||||||||||||||
expectedArrival | string | The ISO 8601 timestamp for the expected arrival at the Job. If no timezone info is supplied, this value is assumed to be UTC (Zulu). This is an absolute time, not a time interval. This field can be updated through the API. It may also be modified by the server during optimization. This field is required when creating a new job. | |||||||||||||||||||||||||||
minutesOnSite | int | (optional) The estimated number of minutes that will be spent on-site to complete this job. This field can be updated through the API. | |||||||||||||||||||||||||||
forms | string[] | (read-only) An array of IDs for completed forms, containing from 0..n form IDs. See Form.Job as well. | |||||||||||||||||||||||||||
notes | string | (optional) An arbitrary string of notes to attach to the Job. This field can be updated through the API. | |||||||||||||||||||||||||||
jobType | string | (optional) The id for the job type that this job is based on. See GET /job_types. If the job type not supplied when a new job is created, the job is given a type of "Stop". | |||||||||||||||||||||||||||
jobName | string | (optional) A human-readable job name. This is the name as entered by the user in Response, or as it displays in Response if it was submitted via the API. | |||||||||||||||||||||||||||
lastUpdateTime | string | (read-only) The ISO 8601 timestamp for when the Job was last updated. This field is used to filter jobs when you use the updated_since query string parameter. | |||||||||||||||||||||||||||
statusLastUpdateTime | string | (read-only) The ISO 8601 timestamp for when the Job Status was last updated. This field is used to filter jobs when you use the updated_since query string parameter. | |||||||||||||||||||||||||||
actualArrival | string | The ISO 8601 timestamp for the actual arrival at the Job. If no timezone info is supplied, this value is assumed to be UTC (Zulu). This field can be updated through the API, but only when setting status to OnSite or Completed. | |||||||||||||||||||||||||||
actualDeparture | string | The ISO 8601 timestamp for the actual departure from the Job. If no timezone info is supplied, this value is assumed to be UTC (Zulu). This field can be updated through the API, but only when setting status to Completed. | |||||||||||||||||||||||||||
markerId | string | Uniquely identifies the marker for the job's location. When you create or update a job, provide the markerId, which will auto-populate the address (do not include both). If you cannot provide the markerId, you must provide the address, for which TDE will create a new marker that is associated with the job. | |||||||||||||||||||||||||||
code | string | Free-form text that can be used to categorize the job. | |||||||||||||||||||||||||||
routeId | string | (optional) Uniquely identifies the route for the job, if it exists. | |||||||||||||||||||||||||||
routeName | string | (read-only) The human-readable name of the route. | |||||||||||||||||||||||||||
custom | JSON object | (read-only) Contains one or more key-value pairs for any custom fields and values defined for the job. The items returned for this object can vary between jobs. |
On success, the response body contains a JSON array of job objects. There will be one entry in the array for each entry in the request body. Only the Id field of the Jobs will be returned.
If the request fails, an Error Response is generated.