Create Location Entry
POSThttps://secure.fleetio.com/api/v1/location_entries
Create a new LocationEntry for a Vehicle or for a Contact. If you need to create many Location Entries at once, use the Bulk API to avoid Rate Limiting errors.
Request
- application/json
Body
- anyOf
- For Contact
- For Vehicle
Possible values: >= 1
We recommend using ISO-8601 formatted dates to avoid ambiguity.
2023-03-14T13:46:27-06:00
Possible values: >= -90
and <= 90
Possible values: >= -90
and <= 90
Possible values: >= 1
We recommend using ISO-8601 formatted dates to avoid ambiguity.
2023-03-14T13:46:27-06:00
Possible values: >= -90
and <= 90
Possible values: >= -90
and <= 90
Responses
- 201
- 401
- 422
- 500
OK
Response Headers
- application/json
- Schema
- Example (auto)
Schema
Possible values: >= 1
The date and time at which this record was created.
2023-03-14T13:46:27-06:00
The date and time at which this record was most recently updated.
2023-03-14T13:46:27-06:00
Possible values: >= 1
The date and time at which this Location Entry was recorded.
2023-03-14T13:46:27-06:00
The type of object that this Location Entry is associated with.
Possible values: [Vehicle
, Contact
]
Possible values: >= 1
The type of object that triggered the creation of this Location Entry, if applicable.
Possible values: [FuelEntry
, ServiceEntry
, SubmittedInspectionForm
]
Possible values: >= 1
Possible values: >= 1
The full address where this Location Entry took place.
address_components objectnullablerequired
Indicates whether this Location Entry is the most recent one for this object.
A string representation of the recorded location.
POINT (33.515000,-86.807610)
Possible values: >= 1
The date and time at which the Vehicle
associated with this Location Entry was archived, if applicable.
The date and time at which the Contact
associated with this Location Entry was archived, if applicable.
{
"id": 0,
"created_at": "2023-03-14T13:46:27-06:00",
"updated_at": "2023-03-14T13:46:27-06:00",
"account_id": 0,
"date": "2023-03-14T13:46:27-06:00",
"item_type": "Vehicle",
"item_id": 0,
"locatable_type": "FuelEntry",
"locatable_id": 0,
"contact_id": 0,
"address": "string",
"address_components": {
"street_number": "string",
"street": "string",
"city": "string",
"region": "string",
"region_short": "string",
"country": "string",
"country_short": "string",
"postal_code": "string"
},
"is_current": true,
"location": "POINT (33.515000,-86.807610)",
"account_membership_id": 0,
"vehicle_archived_at": "2024-07-29T15:51:28.071Z",
"contact_archived_at": "2024-07-29T15:51:28.071Z"
}
Request could not be authenticated
- application/json
- Schema
- Example (auto)
Schema
Possible values: >= 400
and <= 599
A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
{
"status": 0,
"title": "string",
"detail": "string",
"instance": "string"
}
Unprocessable Entity
- application/json
- Schema
- Example (auto)
- Example
Schema
errors object
{
"errors": {}
}
{
"errors": {
"field1": [
"error1",
"error2"
],
"field2": [
"error3"
]
}
}
Something unexpected happened
- application/json
- Schema
- Example (auto)
Schema
Possible values: >= 400
and <= 599
A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
{
"status": 0,
"title": "string",
"detail": "string",
"instance": "string"
}
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
- ruby
- python
- csharp
- go
- java
- nodejs
- php
- CURL
curl -L 'https://secure.fleetio.com/api/v1/location_entries' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Token <Authorization>' \
-H 'Account-Token: <Authorization>' \
-d '{
"contact_id": 0,
"date": "2023-03-14T13:46:27-06:00",
"latitude": 0,
"longitude": 0
}'