Field Representation
The following guidelines apply for the values of object fields in the API (see Field Types for the full list of field types supported by JourneyApps).
text
The text in standard JSON. Example: "Nokia"
Any string in standard JSON format. Example: "Nokia"
integer
The number in standard JSON format. Example: 42
.
Any integer in standard JSON format. Example: 42
.
number
The number in standard JSON format. Example: 3.1428
.
Any decimal number in standard JSON format. Example: 3.1428
.
date
A date in the format YYYY-MM-DD
, as defined by the ISO 8601 specification. Example: "2016-02-27"
.
Any valid date according to the ISO 8601 specification. Any time or timezone components will be stripped. The YYYY-MM-DD
format is recommended. Example: "2016-02-27"
datetime
A date and time in the format YYYY-MM-DDTHH:MM:SSZ
, as defined by the ISO 8601 specification. Note that the time is specified in the UTC/GMT timezone. Example: "2016-02-22T14:00:53Z"
.
Any valid date and time according to the ISO 8601 specification. The YYYY-MM-DDTHH:MM:SSZ
format is recommended. Example: "2016-02-22T14:00:53Z".
single-choice
The key and display label of option. Example: {"key": "soccer", "display": "Soccer"}
The string key of the option. Example: "soccer"
single-choice-integer
The key and display label of option. Example: {"key": 3, "display": "Soccer"}
The integer key of the option. Example: 3
boolean
The key and display label of option. Example: {"key": true, "display": "Yes"}
The boolean key of the option. Example: true
multiple-choice
An array of keys and display labels of the selected options. Example: [{"key": "soccer", "display": "Soccer"}, {"key": "tennis", "display": "Tennis"}]
An array of keys, as explained above. Example: ["soccer", "tennis"]
.
multiple-choice-integer
An array of keys and display labels of the selected options. Example: [{"key": 3, "display": "Soccer"}, {"key": 4, "display": "Tennis"}]
An array of keys, as explained above. Example: [3, 4]
.
location
Hash with fields latitude, longitude, altitude, horizontal_accuracy, vertical_accuracy and timestamp. Note that altitude and vertical_accuracy are typically not reported by mobile devices, and only latitude and longitude can currently be edited on the JourneyApps Backend data browser. The timestamp is automatically populated when the location is captured. See: Location API Response Example
A hash with fields latitude and longitude (both decimal numbers), and optionally altitude, horizontal_accuracy, vertical_accuracy (all decimal numbers) and timestamp (a date and time in the format YYYY-MM-DDTHH:MM:SSZ
, as defined by ISO 8601). Leaving the timestamp blank will cause the current time to be used. If you update an existing GPS location and omit the altitude, horizontal_accuracy or vertical_accuracy fields, any existing values in those fields will be set to null
.
See: Location API Update Object Example
attachment
A hash with fields state, id and original. The attachment's object id is a separate field, where the key is the attachment's field name plus _id
.
See: Attachment API Response Example
A hash with fields base64, containing the Base64 representation of the attachment file, and filename, containing the name of the file. See: Attachment API Update Object Example
Photos
A hash with fields state, thumbnail, fullscreen and original. The photo's object id is a separate field, where the key is the photo's field name plus _id
.
See: Photos API Response Example
A hash with fields base64, containing the Base64 representation of the attachment file, and filename, containing the name of the file. See: Photos and signatures API Update Object Example
Signatures
A hash with fields state, thumbnail, fullscreen, original and svg. The signature's object id is a separate field, where the key is the signature's field name plus _id
.
See: Signatures API Response Example
A hash with fields base64, containing the Base64 representation of the attachment file, and filename, containing the name of the file. See: Photos and signatures API Update Object Example
Relationships
Relationships use the relationship name plus _id
as the key, with the related object id as the value. Only belongs to relationships are included in the object itself, has many relationships should be queried and/or set from the other side of the relationship. Example: building_id: "9913706a-179b-11e2-aaff-0026189d9dc0"
.
The same format is used for setting relationships. Example: building_id: "9913706a-179b-11e2-aaff-0026189d9dc0"
.
Examples
Location API Response Example
Location API Update Object Example
Attachment API Response Example
Attachment API Update Object Example
Note: base64
must not contain any newline characters.
Only the following characters are allowed in filename
:
Lowercase alphanumeric characters
Under score (
_
), hyphen (-
), period (.
) and space (
Photos API Response Example
Note: The state field can be uploaded
,pending
, missing
, or untrusted
. The thumbnail, fullscreen and original fields are only present if state is uploaded
.
Signatures API Response Example
Note: The state field can be uploaded
or pending
. The thumbnail, fullscreen, original and svg fields are only present if state is uploaded
.
Photos and signatures API Update Object Example
Note: base64
must not contain any newline characters.
Only the following characters are allowed in filename
:
Lowercase alphanumeric characters
Under score (
_
), hyphen (-
), period (.
) and space (
Values Not Present
When retrieving objects, a field not present should be interpreted the same as a null
value for that field. This applies to all field types, as well as relationships.
When updating an object with Update a Single Object, setting the field to null
will clear that field. On the other hand, omitting the field will leave its value unchanged. This applies to all field types, as well as relationships.
Last updated