create(…)
Create new vehicle service task. For vehicles with associated tracker only.
parameters:
- task – service task to create. JSON object:
{
"vehicle_id": 222, // id of associated vehicle
"description": "Service task", // max 255 characters
"comment": "", // max 255 characters
"cost": 10050.0000, // for information only
"conditions": { // task end conditions. at least one of fields (mileage or date or engine hours) must be passed.
"mileage": { // optional
"limit": 100, // task limit in kilometers
"notification_interval": 10 // notify about task in specified number of kilometers
},
"date": { // optional
"end": "2015-05-08 09:35:00", // task end date
"notification_interval": 3 // notify about task in specified number of days
},
"engine_hours": { // optional
"limit": 100, // task limit in hours
"notification_interval": 10 // notify about task in specified number of hours
},
},
"start":{ // initial state of service task
"mileage": 11, // odometer value
"date": null, // optional. if null server use it's own current date/time
"engine_hours": 100 // engine hours counter value
},
"notifications": {
"sms_phones": [ //array of phones in international format wo + sign
"79221234567",
"79227654321"
],
"emails": [//array of email addresses
"email@domain.tld",
"email@mail.com"
],
"push_enabled": true // enable/disable push notifications
}
}
return:
{ "success": true }
errors:
- 201 (Not found in database) – vehicle or tracker not found
- 214 (Requested operation or parameters are not supported by the device) – engine hours condition passed but tracker hasn’t ignition sensor