Fleet Connectivity Developer's Guide

Sending a Job to an Asset

This section provides an example of a POST request with details for a new delivery job.

User Story

A logistics company needs to ship a delivery to the HERE Berlin Campus at WGS 84 geocoordinates 52.53086,13.38469. The dispatcher software client, Dispatcher-1, assigns the delivery to the mobile asset, Asset-1. Asset-1 keeps Dispatcher-1 updated on its progress (see the Requesting Updates from the Assets for instructions on how to do this). The dispatcher wants to know when the asset's delay amounts to more than five percent (5%) of the originally calculated time.

Send Job Request Summary

The following list summarizes the elements required to create a request matching the user story and shows, in square brackets, how the request example below uses these elements. Note that the request example also uses the authentication parameters.

Content-Type: application/json
Resource: sendjob.json
Parameters: [apiKey={YOUR_API_KEY}], specifies the authentication apiKey.
Note: When you use an app_id/app_code pair, [app_id={YOUR_APP_ID}] and [app_code={YOUR_APP_CODE}] specify the authentication app_id and app_code. For more information, see Authentication Examples.


Job Request Body
Note: HERE recommends that you follow standard REST paradigms where possible and that you use the POST method to send job request messages to the Fleet Connectivity Web Service. For convenience, when using the Fleet Connectivity API in a pure JavaScript environment, the resource sendjob supports the request parameter job with the GET method, allowing you to send a job request as a parameter.

Send Job Request (as POST)

The code block below demonstrates the complete POST request, specifying that the response data are to be delivered in JSON.
POST body:
  "version" : "1.0",
  "job_id" : "12345",
  "dispatcher_id" : "Dispatcher-1",
  "type" : "NEW_DESTINATION",
  "asset_id" : "Asset-1",
  "message" :"This is an example job.",
  "content" : {
    "destination" : "52.53086,13.38469",
    "avoidAreas" : "50.145743,8.560077;50.139527,8.571493;",
    "mode" : "fastest,car,traffic:enabled"
Note: This example uses a HERE API Key to authenticate your request. For information on other possible options, see Authentication Guide. For examples of how to use the other authentication options with the Fleet Connectivity, see Authentication Examples.

Send Job Response

The response to the request contains:
  • the ID of the job specified in the request
The example response in JSON format is as follows:
  job_id: "12345"