Locations

Create locations for a given vehicle

Creates one or more locations for a given vehicle with the information provided

post/v2/vehicles/{id}/locations

Request

  • Base URL: https://api.onswitchboard.com
  • URL: https://api.onswitchboard.com/v2/vehicles/{id}/locations
  • Auth: API key in header x-api-id and API key in header x-api-key

Request body

companyObjectIdstring

[Deprecated] Unique identifier for the company record

Example request

{
  "companyObjectId": "2ntvSpRGIK",
  "locations": [
    {
      "objectId": "2ntvSpRGIK",
      "id": "2ntvSpRGIK",
      "city": "Vancouver",
      "country": "CA",
      "stateProvince": "BC",
      "longitude": -123.123,
      "latitude": 49.123,
      "dateTime": "2020-01-01T00:00:00.000Z",
      "drivers": [
        {
          "id": "2ntvSpRGIK"
        }
      ],
      "odometerReadingKm": 160424.12,
      "engineHours": 1204.1,
      "speedKm": 84,
      "vehicleSerial": "563062023431345",
      "vehicleVIN": "JTLKE50E581048963",
      "vehicleUnitId": "TRUCK001"
    }
  ]
}

Response

Successully performed operation

Example response

{
  "locations_created": [
    {
      "objectId": "2ntvSpRGIK",
      "id": "2ntvSpRGIK",
      "city": "Vancouver",
      "country": "CA",
      "stateProvince": "BC",
      "longitude": -123.123,
      "latitude": 49.123,
      "dateTime": "2020-01-01T00:00:00.000Z",
      "drivers": [
        {
          "id": "2ntvSpRGIK"
        }
      ],
      "odometerReadingKm": 160424.12,
      "engineHours": 1204.1,
      "speedKm": 84,
      "vehicleSerial": "563062023431345",
      "vehicleVIN": "JTLKE50E581048963",
      "vehicleUnitId": "TRUCK001"
    }
  ],
  "errors": {
    "messages": [
      {
        "code": 400,
        "message": "Bad Request"
      }
    ],
    "locations_not_created": [
      {
        "objectId": "2ntvSpRGIK",
        "id": "2ntvSpRGIK",
        "city": "Vancouver",
        "country": "CA",
        "stateProvince": "BC",
        "longitude": -123.123,
        "latitude": 49.123,
        "dateTime": "2020-01-01T00:00:00.000Z",
        "drivers": [
          {
            "id": "2ntvSpRGIK"
          }
        ],
        "odometerReadingKm": 160424.12,
        "engineHours": 1204.1,
        "speedKm": 84,
        "vehicleSerial": "563062023431345",
        "vehicleVIN": "JTLKE50E581048963",
        "vehicleUnitId": "TRUCK001"
      }
    ]
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.