Response Body
Depending on the value of the ‘resultType’ field in the request body, the result will either be a JSON object as per below specification, an XML string or a JSON object containing a simplified two-dimensional array bearing the results, if the ‘resultType’ is left blank.
Besides the actual query result, the response also contains general information on the error status of the request, a general message and non-fatal errors that have occurred while processing the request.
with the ‘resultType’ parameter in the request body set to ‘JSON’ the response will look like:
{
"error": true,
"message": "string",
"content":
{
"errors": [ "string" ],
"result": [
{
"id": "string",
"name": "string",
"value": 0,
"date": "string",
"rawDate": 0,
"year": 0,
"dueAt": 0,
"dueDate": "string"
} ]
}
}
Please scroll to the bottom of the page to also see the result structure of the other possible ‘resultType’ values.
error
This value returns respectively true or false if the API call has successfully finished or failed. A true value indicates a mistake in the provided query and not HTTP errors such as networking or authentication errors as those are specified in the Response Header.
Type: Boolean
API Version: 1
message
General message about the outcome of the API call. If the ‘error’ field is true, this field may give some more information on the reason of the failure. On a succesfull query this field will simply indicate that.
Type: String
API Version: 1
content
The content field exists of a JSON object containing the actual query results in the ‘result’ field and an array of non-fatal errors that have occured while processing the request.
"content":
{
"errors": [ "string" ],
"result": [
{
"id": "string",
"name": "string",
"value": 0,
"date": "string",
"rawDate": 0,
"year": 0,
"dueAt": 0,
"dueDate": "string"
} ]
}
Type: String
API Version: 1
errors
Array of strings containing error descriptions of any non-fatal errors that occurred while processing the query.
Type: Array(String)
API Version: 1
result
Array of JSON objects in chronological order, each describing the occurence of a schedule item acording the schedule provided in de request body.
"result": [{
"id": "string",
"name": "string",
"value": 0,
"date": "string",
"rawDate": 0,
"year": 0,
"dueAt": 0,
"dueDate": "string"
},
{...}]
Type: Array(JSON Object)
API Version: 1
id
Schedule item id as provided in the request body. (string)
Type: String
API Version: 1
name
Human readable name or description of the schedule item as provided in the request body.
Type: String
API Version: 1
value
Interval value at which this occurence will take place.
Type: Integer
API Version: 1
date
Predicted date at which this occurence will take place, formatted as specified in the dateFormat field of the request body.
Type: String
API Version: 1
rawDate
Predicted date in seconds since the Unix Epoch (January 1 1970 000000 GMT).
Type: Integer
API Version: 1
year
Predicted calendar year of occurrence
Type: Integer
API Version: 1
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.
Type: Integer
API Version: 1
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).
Type: String
API Version: 1
Alternative Result Types
Optionally, the resultType parameter in the request body, instead of ‘JSON’ can also be set to ‘XML’ or can even be left blank, which will lead to the following differences in the returned content.
resultType: XML
When set to XML, the response body will have the same fields and structure as described above, but wil, be formatted as XML instead of JSON. Also the response header will indicate xml as the data-type.
<?xml version="1.0"?>
<response>
<error>Boolean<error/>
<status>Integer</status>
<message>String</message>
<content>
<errors>
<error>String</error>
</errors>
<result>
<row>
<id>String</id>
<name>String</name>
<value>Integer</value>
<date>String</date>
<rawDate>Integer</rawDate>
<year>Integer</year>
<dueAt>Integer</dueAt>
<dueDate>String</dueDate>
</row>
</result>
</content>
</response>
resultType: Blank
If the resultType parameter in the request body is left blank or omitted, the response body will stil, be formatted as JSON, but the result field will not contain the aforementioned array of JSON objects, but instead hold a two-dimensional array of seven columns (without header names), with the values for ‘id’, ‘name’, ‘value’, ‘date’, ‘year’, ‘dueAt’ and ‘dueDate’ on each row.
{
"error": true,
"message": "string",
"content":
{
"errors": [ "string" ],
"result": [
[id, name, value, date, year, dueAt, dueDate],
[...]
]
}
}
