This is an endpoint for creating a trip. A trip belongs to a driver and device with which it was recorded. The minimum number of locations to be sent cannot be less than 5.
In order to obtain accurate analytics, consider submitting trips with duration longer than 5 minutes.
In order to assign trip to the driver you can:
- create driver first using a dedicated endpoint (https://developer.motion-s.com/reference/create_driver_v1_drivers__post) and use the id of created driver as driver_id in the body of this request.
- submit organization_driver_identifier in the body of the request and we will create the driver for you and from then on you can submit trips with that exact organization_driver_identifier
and all of those trips will be linked to this driver.
- if you don't specify driver_id or organization_driver_identifier we will assign the trip to the default driver that was created for your organization.
In order to assign a trip to a device you can:
- create a device first using a dedicated endpoint (https://developer.motion-s.com/reference/create_device_v1_devices__post) and use the id of created device as device_id in the body of this request.
- submit organization_device_identifier in the body of the request and the system will create the device for you and assign it to the default fleet we have created for you, and from then on you can
submit trips with that exact organization_device_identifier and all of those trips will be linked to this device.
- if you don't specify device_id or organization_device_identifier the request will FAIL.
Mandatory field is locations, and one of these two need to be provided along with locations:
- device_id: id of the device you created in our system as indicated above
- organization_device_identifier: the id of the device in your system
Optional fields are:
- metadata: a dictionary with additional data such as the IMEI of the device, or any other data field that can be used for durther analytics
- organization_trip_identifier: the (id or uid) of the trip in your system
- driver_id: id of the driver in our system.
- organization_driver_identifier: the id of the driver in your system
- vehicle_id: id of the vehicle you created in our system
- organization_vehicle_identifier: if provided instead of vehicle_id, a vehicle is created in our system and assigned to your
- trip_timezone: timezone where the trip was done.