Service Interval Settings
When a Vehicle is created, Service Intervals will be automatically created for every Service Interval Setting.
CreateServiceIntervalSetting
Creates a custom Service Interval that can be automatically applied to newly created Vehicles.
Request
curl -L -X POST 'https://{DOMAIN}/voyorequest/CreateServiceIntervalSetting
-d 'name={NAME}&mileage={MILEAGE}&timeframe={TIMEFRAME}'
-H 'Accept: application/json'
-H 'Authorization: Bearer {APIKEY}'
| Parameter | Description | Requirement |
|---|---|---|
name |
Name of the service. | Required |
mileage |
Number of kilometers before reminder is sent. | Optional |
timeframe |
Number of seconds before reminder is sent. | Optional |
While mileage and timeframe are both optional, at least one must be provided.
Parameter name has a max string length of 100 characters.
Example
Let's say we want every Vehicle to be created with a reminder to get an oil change every 5,000 miles.
The request will be:
curl -L -X POST 'https://{DOMAIN}/voyorequest/CreateServiceIntervalSetting
-d 'name=Oil Change&mileage=8046.72'
-H 'Accept: application/json'
-H 'Authorization: Bearer {APIKEY}'
mileage is sent as Kilometers and because timeframe is not needed - it is not included in the request.
Error Responses
HTTP/1.1 400 Bad Request
/// Provided name is too long
{ "error":"name can not be more than 100 characters!" }
// Negative numbers and extremely large values are not allowed
{ "error":"Mileage until vehicle maintenance is outside of valid range!" }
// Timeframe allows any number of seconds between now and 5 years from now
{ "error":"Seconds until vehicle maintenance is outside of valid range!" }
/// While both optional, at least one (mileage/timeframe) must be provided
{ "error":"Requires at least mileage or timeframe!" }
Success Responses
Service Interval Setting was created successfully.
{ "error":"Success!", "id":"" }
id is a unique identifier that can be used to update or remove Service Interval Setting.
GetServiceIntervalSettings
Get a list of all Service Interval Settings.
Request
Please note that this is a GET request and not a POST request.
curl -L -X GET 'https://{DOMAIN}/voyorequest/GetServiceIntervalSettings
-H 'Accept: application/json'
-H 'Authorization: Bearer {APIKEY}'
Example Response
Response settings can be empty if no Service Interval Settings have been created or there are none left.
{
"error":"Success!", "settings":[
{
"id":"",
"created_at":"",
"name":"",
"mileage":"",
"timeframe":""
}
]
}
If a Service Interval Setting was created with mileage and not timeframe it will be returned with mileage, and not timeframe included.
RemoveServiceIntervalSetting
Delete a created Service Interval Setting.
Request
curl -L -X POST 'https://{DOMAIN}/voyorequest/RemoveServiceInterval
-d 'id={ID}'
-H 'Accept: application/json'
-H 'Authorization: Bearer {APIKEY}'
| Parameter | Description |
|---|---|
id |
Unique identifier of a Service Interval Setting. |
Error Responses
HTTP/1.1 400 Bad Request
// Service interval setting identifier was invalid
{ "error":"Requires non-zero identifier!" }
Success Responses
Service Interval Setting was removed successfully.
{ "error":"Success!" }
UpdateServiceIntervalSetting
Update a Service Interval Setting by id.
An updated setting will take effect going forward i.e for newly created Vehicles.
Request
curl -L -X POST 'https://{DOMAIN}/voyorequest/UpdateServiceIntervalSetting
-d 'id={ID}&name={NAME}&mileage={MILEAGE}&timeframe={TIMEFRAME}'
-H 'Accept: application/json'
-H 'Authorization: Bearer {APIKEY}'
| Parameter | Description | Requirement |
|---|---|---|
id |
Unique identifier belonging to a previously created Service Interval Setting. | Required |
name |
Name of the service that will be provided after mileage/timeframe. | Optional |
mileage |
Number of kilometers before reminder for maintenance is sent. | Optional |
timeframe |
Number of seconds before reminder for maintenance is sent. | Optional |
At least one of the optional fields above must be included.
Error Responses
HTTP/1.1 400 Bad Request
For a more detailed response check the following error descriptions:
// Provided service interval setting id is invalid
{ "error":"Requires non-zero identifier!" }
// Name is too long
{ "error":"name can not be more than 100 characters!" }
// Negative numbers and extremely large values are not allowed
{ "error":"Mileage until vehicle maintenance is outside of valid range!" }
// Timeframe allows any number of seconds between now and 5 years from now
{ "error":"Seconds until vehicle maintenance is outside of valid range!" }
// Update request requires something to update
{ "error":"Requires at one field to update!" }
Success Responses
Service Interval Setting was updated successfully.
{ "error":"Success!" }