Data types

Here is how various data types not native to JSON are encoded.

Datetime

Datetime is date and time passed as a single value.

Datetime values are passed around as strings in the ISO 8601 format.

Example: "2015-03-15T10:28:27+00:00" is March 15, 2015, at 10:28:27 in UTC. Note T separating date and time.

For certain fields datetime values can have higher precision by including milliseconds: "2015-03-15T10:28:27.673+00:00".

Timestamp

The rules are the same as for datetime but precision is up to microseconds: "2015-03-15T10:28:27.673531+00:00".

Date

As with datetime, ISO 8601 is used to represent dates.

Example: "2014-09-04" is September 4, 2014.

Time

Time is precise up-to-minutes. Values use the 24-hour format.

Example: "15:23".

Time with seconds is not valid.

Duration

Duration is passed as object with the "minutes" key.

Example: {"minutes": 1913} is 1 day, 7 hours, 53 minutes.

Geolocation

Geolocation is a single point described by longitude and latitude values. Geolocations are always represented as a JSON object with two fields.

Example: {"longitude": 13.3363265, "latitude": 52.4984896}.