/schedule
Request Headers:
The headers to be provided with every request are:
- “X-RapidAPI-Key”:”[Insert_Your_RapidAPI-Key_here]“,
- “X-RapidAPI-Host”:”maintenanceman-nl-asset-management-api.p.rapidapi.com”
- “x-rapidapi-ua”: “RapidAPI-Playground”
Request Type:
The request body for every request needs to be in JSON (JavaScript Object Notation) as specified below. Therefore the request type should be set to ‘application/json’.
Request Body
The request body for each request must be built up as per below specification.
{
"schedule":
[ {
"id": "string",
"name": "string",
"interval":
{ "units": 0,
"orDays": 0,
"after": "string" },
"willReset": "string",
"lastExecutedDate": "string",
"lastExecutedValue": 0,
"preserveOnOverdueReset": true,
"mergeLimit":
{
"units": 0,
"orDays": 0 }
}
],
"period": 0,
"unitsPerDay": 0,
"currentDate": "string",
"currentUnits": 0,
"dateZero":"string",
"resultType": "string",
"dateFormat": "string"
}
Request body parameters
schedule
Array of schedule items. (Array)
id
Unique key for reference to this schedule item. (string)
name
Human readable name or description of the schedule item. (string, optional)
interval
Object containing interval parameters. (JSON object)
units
Interval in number of units. Unit of measure is not specified but needs to be the same throughout the schedule. (integer)
orDays
Interval in calendar days as alternative to (and usable in combination with) ‘units’. (integer, optional)
after
Use this field to make the interval occur X units or days after another schedule item instead of recurring on it’s own interval. You can provide an id or a comma separated string of id’s. (string, optional)
willReset
Use this field to reset another schedule item to zero. This is typically used for schedule items that include the scope of others items. (E.g. when a major service includes an oil change and therefore counting for oil change intervals should restart at zero). You can provide an id or a comma separated string of id’s. (string, optional)
lastExecutedDate
Last known execution date of schedule item. Supported date formats for this field are**ISO-8601, RFC 822, RFC 850, RFC 1036, RFC 1123, RFC 2822, RFC 3339, RSS or the W3C format. Other formats may work as well, but make sure to test them before use. (string)
lastExecutedValue
Units value of the last known execution of the schedule item. (integer)
preserveOnOverdueReset
Set this field to true if the schedule item needs to reccur even if the schedule item resetting the current one is over due. (E.g. if a major service is delayed for whichever reason, you may need to make sure that oil changes are still executed in time). If not set, or if set to false, the schedule item may be reset by another item, even if that’s not executed and overdue. (boolean, optional)
mergeLimit
If this field is set and the execution comes within the specified limit before another item that resets the current one, this schedule item will not be executed. (E.g. if a major service is due in X units or days, you might want to cancel an oil change if due). (JSON opject, optional)
period
Period in ‘days’ for schedule to be returned. This value is automatically limited to a maximum of 50 years. (integer)
unitsPerDay
Average number of units per day to base the outputted schedule on. This is the measure for how intensively the asset is used. (integer)
currentDate
Date to be used as the current point in time. This Value must be equal or greater than the latest ‘lastExecutedDate’. Supported date formats for this field are**ISO-8601, RFC 822, RFC 850, RFC 1036, RFC 1123, RFC 2822, RFC 3339, RSS or the W3C format. Other formats may work as well, but make sure to test them before use. (string)
currentUnits
Current value for ‘units’. This value must be equal to or greater than the greatest ‘lastExecutedValue’ value. (integer)
dateZero
Date of first asset operation . This is a helper value that may prevent unexpected output on some exotic schedules. It is recommended to always specify this value, but if not specified the, API will use a virtual date instead. (string, optional).
resultType
If not set or if set to any other value than ‘JSON’ the API call result will be a two dimensional array containing the columns ‘id’, ‘name’, ‘value’, date, year, dueAt and dueDate. The array does not include header names. This is only convenient for direct output to e.g. a spreadsheet. For any other use case, you may want to set this field to ‘JSON’, which will result in a JSON object as described below. (string)
dateFormat
A date format to be used in the API call result. (E.g. y-M-d). The usable charachters to use for this field are:
- d – The day of the month (from 01 to 31)
- D – A textual representation of a day (three letters)
- j – The day of the month without leading zeros (1 to 31)
- l (lowercase ‘L’) – A full textual representation of a day
- N – The ISO-8601 numeric representation of a day (1 for Monday, 7 for Sunday)
- S – The English ordinal suffix for the day of the month (2 characters st, nd, rd or th.)
- w – A numeric representation of the day (0 for Sunday, 6 for Saturday)
- z – The day of the year (from 0 through 365)
- W – The ISO-8601 week number of year (weeks starting on Monday)
- F – A full textual representation of a month (January through December)
- m – A numeric representation of a month (from 01 to 12)
- M – A short textual representation of a month (three letters)
- n – A numeric representation of a month, without leading zeros (1 to 12)
- t – The number of days in the given month
- L – Whether it’s a leap year (1 if it is a leap year, 0 otherwise)
- o – The ISO-8601 year number
- Y – A four digit representation of a year
- y – A two digit representation of a year
- e – The timezone identifier (Examples**UTC, GMT, Atlantic/Azores)
- O – Difference to Greenwich time (GMT) in hours (Example**+0100)
- P – Difference to Greenwich time (GMT) in hours:minutes
- T – Timezone abbreviations (Examples**EST, MDT)
- Z – Timezone offset in seconds. The offset for timezones west of UTC is negative (-43200 to 50400)
- c – The ISO-8601 date (e.g. 2013-05-05T16:34:42+00:00)
- r – The RFC 2822 formatted date (e.g. Fri, 12 Apr 2013 12:01:05 +0200)
- U – The seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
Please note that, if no time zone is specified, UTC time will be used.
Result
Depending on the value of the ‘resultType’ field the result will either be a JSON object as per below specification if the ‘resultType’ is set to ‘JSON’ or a headerless, two dimensional array with the columns ‘id’, ‘name’, ‘value’, date, year, dueAt and dueDate.
Result Body
{
"error": true,
"message": "string",
"content":
{
"errors": [ "string" ],
"result": [
{
"id": "string",
"name": "string",
"value": 0,
"date": "string",
"rawDate": 0,
"year": 0,
"dueAt": 0,
"dueDate": "string"
} ]
}
}
Result parameters
error
This value returns respectively true or false if the API call has successfully finished or failed. (boolean)
message
General message about the outcome of the API call. (string)
content
JSON object containing the actual query results. (object)
errors
Array of strings containing error descriptions of any possible errors that occurred while processing the query. (array)
result
Array of JSON objects in chronological order, each describing the occurence of a schedule item acording the schedule provided in de request body. (array)
id
Schedule item id as provided in the request body. (string)
name
Human readable name or description of the schedule item as provided in the request body. (string)
value
Interval value at which this occurence will take place. (integer)
date
Predicted date at which this occurence will take place, formatted as specified in the dateFormat field of the request body. (string)
rawDate
Predicted date in seconds since the Unix Epoch (January 1 1970 000000 GMT). (string)
year
Predicted calendar year of occurrence (integer)
dueAt
Interval value at which the schedule item should have occurred. Only given for overdue ocurrences and only if the due date is based on the ‘units’ value. (integer)
dueDate
Date at which the schedule item should have occurred, formatted as specified in the dateFormat field of the request body. Only given for overdue occurrences and only if the due date is calendar based. (string).