Skip to main content

Create Location Entry

POST 

https://secure.fleetio.com/api/v1/vehicles/:id/location_entries

Create a new LocationEntry. If you need to create many Location Entries at once, use the Bulk API to avoid Rate Limiting errors.

Request

Path Parameters

    id stringrequired

Body

    contact_idintegernullable
    datedate-time

    We recommend using ISO-8601 formatted dates to avoid ambiguity.

    Example: 2023-03-14T13:46:27-06:00
    latitudenumber

    Possible values: >= -90 and <= 90

    longitudenumber

    Possible values: >= -90 and <= 90

Responses

OK

Response Headers
    Schema
      idinteger

      Possible values: >= 1

      created_atdate-time

      The date and time at which this record was created.

      Example: 2023-03-14T13:46:27-06:00
      updated_atdate-time

      The date and time at which this record was most recently updated.

      Example: 2023-03-14T13:46:27-06:00
      datedate-timerequired

      The date and time at which this Location Entry was recorded.

      Example: 2023-03-14T13:46:27-06:00
      vehicle_idId (integer)

      Possible values: >= 1

      item_typestringrequired

      The type of object that this Location Entry is associated with.

      Possible values: [Vehicle, Equipment]

      item_idNullableId (integer)nullablerequired

      Possible values: >= 1

      locatable_typestringnullablerequired

      The type of object that triggered the creation of this Location Entry, if applicable.

      Possible values: [FuelEntry, ServiceEntry, SubmittedInspectionForm]

      locatable_idNullableId (integer)nullablerequired

      Possible values: >= 1

      contact_idNullableId (integer)nullablerequired

      Possible values: >= 1

      addressstringnullablerequired

      The full address where this Location Entry took place.

      address_components objectnullablerequired
      street_numberstring

      The street number in the address.

      streetstring

      The street name in the address.

      citystring

      The city in the address.

      regionstring

      The region, state or province in the address.

      region_shortstring

      The abbreviated region, state or province code.

      countrystring

      The country in the address.

      country_shortstring

      The abbreviated country code.

      postal_codestring

      The postal code, ZIP, or equivalent in the address.

      is_currentbooleanrequired

      Indicates whether this Location Entry is the most recent one for this object.

      locationstringrequired

      A string representation of the recorded location.

      Example: POINT (33.515000,-86.807610)
      geolocation objectrequired

      The coordinates of the recorded location.

      latitudeCoordinate (number)

      Possible values: >= -90 and <= 90

      longitudeCoordinate (number)

      Possible values: >= -90 and <= 90

    Authorization: Authorization

    name: Authorizationtype: apiKeyin: headerdescription: Prefix the value with "Token", for example: "Token 76cbe06c49a64".
    You can generate a new API key [here](https://secure.fleetio.com/api_keys).
    name: Account-Tokentype: apiKeyin: headerdescription: You can find your Account-Token [here](https://secure.fleetio.com/api_keys)
    curl -L 'https://secure.fleetio.com/api/v1/vehicles/:id/location_entries' \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: <Authorization>' \
    -H 'Account-Token: <Authorization>' \
    -d '{
    "contact_id": 0,
    "date": "2023-03-14T13:46:27-06:00",
    "latitude": 0,
    "longitude": 0
    }'
    Request Collapse all
    Base URL
    https://secure.fleetio.com/api
    Auth
    Parameters
    — pathrequired
    Body
    {
      "contact_id": 0,
      "date": "2023-03-14T13:46:27-06:00",
      "latitude": 0,
      "longitude": 0
    }
    
    ResponseClear

    Click the Send API Request button above and see the response here!