JSON Format and Guidelines

All responses are in JSON and use the following format and guidelines.

Header Values

The JSON headers use the following values:

  • Content-Type: application/json

  • Accept: application/json
  • Cookie: JSESSIONID=[jSessionCookie]

  • Authorization: [sessionToken]

Schema Data Type to JSON Data Type Mapping

The Oracle Utilities Application Framework schema data types are listed below, along with the corresponding JSON data types that they are mapped to:

  • Group: Object

  • List: Array

  • Sting: String

  • Lookup: String

  • Number: Number

  • Money: Number
  • Date: String

  • Date/Time: String

  • Time: String

  • Boolean: Boolean

JSON Format

The well-formed JSON adheres to the following standards and guidelines.

When using JSON the request payload may look like:

{"scriptname": {"input": {"fieldA": "ABC", "fieldB": 12345} } }

The corresponding output may look like:

{"scriptname": {"input": {"fieldA": "ABC", "fieldB": 12345}, "output":{"result": "def"} } }

For schemas that include lists the JSON returns an instance for each row. For example:

{"scriptName": {"outputList": [ {"item": "one"}, {"item": "two"} ] }}

Additional standards include the following:
  • Keys are double-quoted.
  • Key names must be valid JS identifiers. For example, "username" instead of "user name" or "user-name."
  • Strings are double-quoted.
  • Dates are encoded in YYYY-MM-DD format, for example, "2009-03-04".
  • Timestamps are encoded as ISO 8601 Strings, for example, "2011-05-09T20:55:59.547Z".
    • An ISO8601 timestamp (http://www.w3.org/TR/NOTE-datetime) generally follows the form YYYY-MM-DDT12:00:00Z or YYYY-MM-DDT12:00:00+XX:00. While the ISO8601 standard allows for timezone information to be omitted, timezone must be passed to this service.
    • Depending on the timezone you decide to use, you may be required to encode certain characters in your URL, such as the "+" character that appears in some timestamps (for example: 2013-10-16T12:06:00+04:00).
  • Booleans are used for Boolean values, as opposed to 1 or 0 or "true" or "false."