Click or drag to resize
POST /payload_message
Print this page
Description

This service is used to create a new PayloadMessage to support generation of messages and alerts directly from TDE.

Request

For any PayloadMessage object, you must specify whether it is a message for a unit, a driver, or a job, and the message must include the corresponding Id of that unit, driver, or job.

The Request body is a JSON array of PayloadMessage objects describing the message contents.

Member Type Purpose
timestamp string (optional) The ISO 8601 timestamp for when the payload message was generated. If not supplied, defaults to the server's time in UTC.
targetType string (required) Specifies what kind of target the message describes. Values: (1) unit, (2) driver, (3) job. Use the number or the word for the value. The associated Id must be supplied.
unitId string (required for targetType 1/unit) Identifies the vehicle that is associated with the message.
driverId string (required for targetType 2/driver) Identifies the driver that is associated with the message.
jobId string (required for targetType 3/job) Identifies the job that is associated with the message.
lat double? (optional) The latitude of the location, in degrees. The value can be given as a string.
lon double? (optional) The longitude of the location, in degrees. The value can be given as a string.
gpsQuality string (optional) The quality of the GPS fix. Values: (0) Off, (1) NoFix, (2) Unreliable, (3) Excellent. Use the number or the word for the value.
heading int? (optional) The heading (direction) of the vehicle, in degrees (0 is north, 90 is east). The value can be given as a string.
name string (required) The name that describes the data object (such as "DVIR failure").
data JSON object (required) Contains one or more custom key-value pairs to hold the data associated with the payload (such as "noDefects":true).

Response

On success, the response body contains a JSON array of PayloadMessage 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.