Overview

APIs

Topics

Vehicles

You can provide us with vehicle locations and they'll be shown live on the user's map of the farm.

We will request vehicle data from you via the Data API:

Message Description
vehicles.locations The current location of all of the vehicles on the farm

Data API vehicles.locations

Provides the last known location of all connected farm vehicles.

Message type vehicles.locations
Required scopes vehicles:write

Request

Example request

{
    "type": "vehicles.locations",
    "farm_id": "8740a65d-1fdd-4c2b-bb52-d5b84984fa63",
    "token": "3d0daa4b484743bfaf20721f9bf76eb4"
}

We will request vehicle locations from you via the Data API when they are requested by the user.

Response

Example response

{
    "locations": [
        {
            "vehicle": {
                "id": "1234",
                "name": "Old Rusty",
                "location": {
                    "lat": 41.597164,
                    "lng": -90.54383
                },
                "active": true,
            },
            "updated_at": "2018-03-08T11:22:27Z"
        }
    ]
}

The response should contain a list of all vehicles on the farm that have a location. It should contain the following fields:

Field Required Description
vehicle Required Vehicle information and location
updated_at Required The date and time the vehicle last reported its location

A vehicle is defined as:

Field Required Description
id Required Unique ID of the vehicle
name Required Human readable label
location Required Last known location
active Optional If the vehicle is functional and reporting locations