The JSON (JavaScript Object Notation) is the data-interchange format used by TIBCO EBX® RESTful operations.
This format is lightweight, self-describing and can be used to design UIs or to integrate EBX® in a company's information system.
The data context is exhaustive, except for association fields and selection nodes that are not directly returned. However, these fields are included in the response with a URL link named details
included by default. It can be indirectly used to get the fields content.
The volume of data is limited by a pagination mechanism activated by default, it can be configured or disabled.
URL formatted links allow retrieving:
Tables, records, dataset non-terminal nodes, foreign keys, resource fields (property details
).
Possible values for foreign keys or enumerations (selector
parameter).
JSON data are always encoded in UTF-8.
Request body is represented by a JSON Object
whose content varies according to the operation and its category.
The request body holds several properties directly placed in the root JSON Object
.
Token creation
Specifies the login
and password
to use for an authentication token creation attempt.
{ "login": "...", // JSON String "password": "..." // JSON String }
Specifies the specific
attribute, to activate the user authentication against the HTTP request, for an authentication token creation attempt.
{ "specific": true // JSON Boolean }
Password change
Specifies the login
, password
and passwordNew
to use for the password change.
{ "login": "...", // JSON String "password": "...", // JSON String "passwordNew": "..." // JSON String }
The request body contains at least a content
property where master data values will be defined.
Dataset node
Specifies the target values of terminal nodes under the specified node. This request is used on the dataset node update operation.
{ "content": { "nodeName1": { "content": true }, "nodeName2": { "content": 2 }, "nodeName3": { "content": "Hello" } } }
Record
Specifies the target record content by setting the value for each field. For missing fields, the behavior depends on the request parameter byDelta
. This structure is used on table record insert or on record update.
Some technical data can be added beside the content
property such as lastUpdateDate
.
{ ... "lastUpdateDate": "2015-12-25T00:00:00.001", ... "content": { "gender": { "content": "Mr." }, "lastName": { "content": "Chopin" }, "lastName-en": { "content": "Chopin", "inheritedFieldMode": "inherit" }, "firstName": { "content": "Fryderyk" }, "firstName-en": { "content": "Frédéric", "inheritedFieldMode": "overwrite" }, "birthDate": { "content": "1810-03-01" }, "deathDate": { "content": "1849-10-17" }, "jobs": { "content": [ { "content": "CM" }, { "content": "PI" } ] }, "infos": { "content": [ { "content": "https://en.wikipedia.org/wiki/Chopin" } ] } } }
Record fields
Specifies the target values of fields under the record terminal node by setting the value of each field. For missing fields, the behavior depends on the request parameter byDelta
. This structure is only used for table record updates.
{ "content": [ { "content": "CM" }, { "content": "PI" } ] }
Record table
Defines the content of one or more records by indicating the value of each field. For missing fields, the behavior depends on the parameter of the request byDelta
. This structure is used upon insert or update of records in the table.
{ "rows": [ { "content": { "gender": { "content": "M" }, "lastName": { "content": "Saint-Saëns" }, "firstName": { "content": "Camille" }, "birthDate": { "content": "1835-10-09" }, ... } }, { "content": { "gender": { "content": "M" }, "lastName": { "content": "Debussy" }, "firstName": { "content": "Claude" }, "birthDate": { "content": "1862-10-22" }, ... } } ] }
Record table to be deleted
Defines one or more records. This structure is used upon deleting several records from the same table.
{ "rows": [ { "details": "http://.../root/table/1" }, { "details": "http://.../root/table/2" }, { "primaryKey": "./oid=3" }, { "foreignKey": "4" }, ... ] }
Field
Specifies the target field content. This request is used on the field update.
The request has the same structure as defined in node value by only keeping the content
entry. Other entries are simply ignored.
Open or close user interface
Specifies whether the user interface is open or close and the unavailability message.
{ "content": { "toolStatus": { "content": true // or false }, "toolStatusCloseMessage": { "content": "Access is temporarily forbidden for maintenance." } } }
Only writable fields can be mentioned in the request, this excludes the following cases:
Association node,
Selection node,
Value function,
JavaBean field that does not have a setter,
Unwritable permission on node for authenticated user.
The response body is represented by a JSON Object
whose content depends on the operation and its category.
The selection operation for this category only provides the values corresponding to the request under a content
property.
System information
Contains EBX® instance's system information. The representation of these data can be flat or hierarchical.
Flat representation:
{ "content": { "bootInfoEBX": { "label": "EBX® configuration", "content": { "product.version": { "label": "EBX® product version", "content": "5.8.1 [...] Enterprise Edition" }, "product.configuration.file": { "label": "EBX® main configuration file", "content": "System property [ebx.properties=./ebx.properties]" } // others keys } }, "repositoryInfo": { "label": "Repository information", "content": { "repository.identity": { "label": "Repository identity", "content": "00905A5753FD" }, "repository.label": { "label": "Repository label", "content": "My repository" } // others keys } }, "bootInfoVM": { "label": "System information", "content": { "java.home": { "label": "Java installation directory", "content": "C:\\JTools\\jdk1.8.0\\jre" }, "java.vendor": { "label": "Java vendor", "content": "Oracle Corporation" } // others keys } } } }
Hierarchical representation:
{ "content": { "bootInfoEBX": { "label": "EBX® configuration", "content": { "product": { "content": { "version": { "label": "EBX® product version", "content": "5.8.1 [...] Enterprise Edition" }, "configuration": { "content": { "file": { "label": "EBX® main configuration file", "content": "System property [ebx.properties=./ebx.properties]" } } } } }, "vm": { "content": { "startTime": { "label": "VM start time", "content": "2017/09/11-10:04:17-0729 CEST" }, "identifier": { "label": "VM identifier", "content": "1" } } } // other hierarchical keys } } } }
The response body contains several properties directly placed in its root JSON object
.
Token creation
Contains the token value and its type.
{ "accessToken": "...", // JSON String "tokenType": "..." // JSON String }
The selection operation contains two different parts.
The first one named meta
contains the exhaustive structure of the response.
The other, regrouping content
, rows
, pagination
...etc, contains the values corresponding to the request.
Dataset tree
Contains the hierarchy of table
and non-terminal group
nodes.
{ "meta": { "fields": [ { "name": "rootName", "label": "Localized label", "description": "Localized description", "type": "group", "pathInDataset": "/rootName", "fields": [ { "name": "settings", "label": "Settings", "type": "group", "pathInDataset": "/rootName/settings", "fields": [ { "name": "settingA", "label": "A settings label", "type": "group", "pathInDataset": "/rootName/settings/settingA" }, { "name": "settingB", "label": "B settings label", "type": "group", "pathInDataset": "/rootName/settings/settingB" } ] }, { "name": "table1", "label": "Table1 localized label", "type": "table", "minOccurs": 0, "maxOccurs": "unbounded", "pathInDataset": "/rootName/table1" }, { "name": "table2", "label": "Table2 localized label", "type": "table", "minOccurs": 0, "maxOccurs": "unbounded", "pathInDataset": "/rootName/table2" } ] } ] }, "validation": [ { "level": "error", "message": "Value must be greater than or equal to 0.", "details": "http://.../rootName/settings/settingA/settingA1?includeValidation=true" }, { "level": "error", "message": "Field 'Settings A2' is mandatory.", "details": "http://.../rootName/settings/settingA/settingA2?includeValidation=true" } ], "content": { "rootName": { "details": "http://.../rootName", "content": { "settings": { "details": "http://.../rootName/settings", "content": { "weekTimeSheet": { "details": "http://.../rootName/settings/settingA" }, "vacationRequest": { "details": "http://.../rootName/settings/settingB" } } }, "table1": { "details": "http://.../rootName/table1" }, "table2": { "details": "http://.../rootName/table2" } } } } }
The meta
and validation
properties are optional.
Dataset node
Contains the list of terminal nodes under the specified node.
{ "meta": { "fields": [ { "name": "nodeName1", "label": "Localized label of the field node 1", "description": "Localized description", "type": "boolean", "minOccurs": 1, "maxOccurs": 1, "pathInDataset": "/rootName/.../nodeName1" }, { "name": "nodeName2", "label": "Localized label of the field node 2", "type": "int", "minOccurs": 1, "maxOccurs": 1, "pathInDataset": "/rootName/.../nodeName2" } ] }, "content": { "nodeName1": { "content": true }, "nodeName2": { "content": -5, "validation": [ { "level": "error", "message": "Value must be greater than or equal to 0." } ] } } }
Table
JSON Object
containing the properties:
(Optional) The table meta data,
(Optional) The sort criteria applied,
(Optional) The table validation report,
rows
containing a table of selected records. Each record is represented by an object, if no record is selected then the table is empty.
(Optional) pagination
containing pagination information if activated.
{ "rows": [ { "label": "Claude Levi-Strauss", "details": "http://.../root/individu/1", "content": { "id": { "content": 1 }, ... } }, { "label": "Sigmoud Freud", "details": "http://.../root/individu/5", "content": { "id": { "content": 2 }, ... } }, ... { "label": "Alfred Dreyfus", "details": "http://.../root/individu/10", "content": { "id": { "content": 30 }, ... } } ], "sortCriteria": [ { "path": "/name", "order": "lasc" }, ... ], "pagination": { "firstPage": null, "previousPage": null, "nextPage": "http://.../root/individu?pageRecordFilter=./id=9&pageSize=9&pageAction=next", "lastPage": "http://.../root/individu?pageSize=9&pageAction=last" } }
Record
JSON object
containing:
The label,
(Optional) The record URL,
(Optional) The technical data,
(Optional) The table metadata,
(Optional) The record validation report,
(Optional) The inheritance mode of the record is: root
, inherit
, overwrite
or occult
. This value is available for a child dataset,
The record content.
{ "label": "Name1", "details": "http://.../rootName/table1/pk1", "creationDate": "2015-02-02T19:00:53.142", "creationUser": "admin", "lastUpdateDate": "2015-09-01T17:22:24.684", "lastUpdateUser": "admin", "inheritanceMode": "root", "meta": { "name": "table1", "label": "Table1 localized label", "type": "table", "minOccurs": 0, "maxOccurs": "unbounded", "primaryKeys": [ "/pk" ], "inheritance": "true", "fields": [ { "name": "pk", "label": "Identifier", "type": "string", "minOccurs": 1, "maxOccurs": 1, "pathInRecord": "pk", "filterable": true, "sortable": true }, { "name": "name", "label": "Name", "type": "string", "minOccurs": 1, "maxOccurs": 1, "pathInRecord": "name", "filterable": true, "sortable": true }, { "name": "name-fr", "label": "Nom", "type": "string", "minOccurs": 1, "maxOccurs": 1, "inheritedField": { "sourceNode": "./name" }, "pathInRecord": "name-fr", "filterable": true, "sortable": true }, { "name": "parent", "label": "Parent", "description": "Localized description.", "type": "foreignKey", "minOccurs": 1, "maxOccurs": 1, "foreignKey": { "tablePath": "/rootName/table1", "details": "http://.../rootName/table1" }, "enumeration": "foreignKey", "pathInRecord": "parent", "filterable": true, "sortable": true } ] }, "content": { "pk": { "content": "pk1" }, "name": { "content": "Name1" }, "name-fr": { "content": "Name1", "inheritedFieldMode": "inherit" }, "parent": { "content": null, "validation": [ { "level": "error", "message": "Field 'Parent' is mandatory." } ] } }, "validation": { ... } }
Fields
For association or selection nodes, contains the target table with associated records if, and only if, the includeDetails
parameter is set to true
.
For other kinds of nodes, contains the current node value, by adding meta
entry if enabled.
Retrieve the user interface state
Contains the user interface status and the unavailability message.
{ "content": { "toolStatus": { "content": true, "label": "Open", "selector": "http://.../domain/toolStatus/toolStatus?selector=true", }, "toolStatusCloseMessage": { "content": "Access is temporarily forbidden for maintenance.", } } }
Node, records and field in meta
, rows
and content
may be hidden depending on their resolved permissions (see permissions).
This section can be activated on demand with the includeMeta
parameter. It describes the structure and the JSON typing of the content
section.
This section is deactivated by default for selection operations.
Table meta-data is represented by a JSON object
with the following properties:
JSON property | JSON format | Description | Required |
---|---|---|---|
|
| Name of the table defined in schema. | Yes |
|
| Table label. If undefined, the name of the schema node is returned. | Yes |
|
| Table description. | No |
|
| Always equal to: | Yes |
|
| Number of minimum authorized record(s). | Yes |
|
| Number of maximum authorized record(s) or | Yes |
|
| Specifies if the table content is historized. Its value is See also | No |
|
| Array of the paths corresponding to the primary key. | Yes |
|
| Specifies whether the dataset inheritance is activated for the table. Its value is See also | No |
|
| Array of fields, that are direct children of the record node. Each field may also recursively contain sub-fields. | Yes |
Each authorized field is represented by a JSON object
with the following properties:
JSON property | JSON format | Description | Required |
---|---|---|---|
|
| Name of the current authorized schema node. | Yes |
|
| Node label. If undefined, the name of the schema node is returned. | Yes |
|
| Node description. | No |
|
| Node type: simple type, | Yes |
|
| Number of minimum authorized occurrence(s). | Yes |
|
| Number of maximum authorized occurrence(s) or | Yes |
|
| Holds information related to the inherited field's value source. "inheritedField": { "sourceRecord": "/path/to/record", // (optional) "sourceNode": "./path/to/Node" } See also | No |
|
| Contains information related to the target table. { "dataspace": "BAuthors", "dataset": "Authors", "tablePath": "/root/Authors", "details": "http://.../BAuthors/Authors/root/Authors" } | No (*) |
|
| Target dataspace or snapshot identifier. This property is placed under the | No (*) |
|
| Target dataset identifier. This property is placed under the | No (*) |
|
| Target table path. This property is placed under the | Yes |
|
| Target table URL. This property is placed under the | No |
|
| Specifies if the field is an enumeration value. Possible values are:
See alsoSpecifies whether the field can be used for retrieving possible values by using the | No |
|
| Specifies if the field is a computed value. See also | No |
|
| Relative field path starting from the schema node. | No (**) |
|
| Relative field path starting from the table node. | No (*) |
|
| Specifies whether the field can be used for filtering record using | No (*) |
|
| Specifies whether the field can be used in sort criteria using | No (*) |
|
| Contains the structure and typing of each group field. | No |
(*) Only available for table, record and record field operations.
(**) Only available for dataset tree operations.
The sort criteria applied to the request can be returned on demand, by using the includeSortCriteria
parameter (deactivated by default). If it is activated, a sortCriteria
property is directly added to the response root node.
A sortCriteria
property contains a JSON Array
that contains ordered sort criteria, and for each sort criterion, a JSON Object
is added with the following properties:
JSON property | JSON format | Description | Required |
---|---|---|---|
|
| Field path. | Yes |
|
| Possible values are: | Yes |
The validation can be activated on demand with the includeValidation
parameter (deactivated by default). If it is activated, validation
properties are directly added on target nodes with one or several messages. For messages without a target node path, a validation
property is added on the root node.
A validation
property contains a JSON Array
and for each message, corresponding to a validation item, a JSON Object
with properties:
JSON property | JSON format | Description | Required |
---|---|---|---|
|
| Severity of the validation item, the possible values are: | Yes |
|
| Description of the validation item. | Yes |
|
corresponding to an absolute URL. | URL of the resource associated with the validation item. Only available on the table and dataset scopes, if associated resources exist and if it is included. See also | No |
This section can be deactivated on demand with the includeContent
parameter (activated by default). It provides the content of the record values, dataset, or field of one of the content fields for an authorized user. It also has additional information, including labels, technical information, URLs...
The content is represented by a JSON Object
with a property set for each sub-node.
JSON property | JSON format | Description | Required |
---|---|---|---|
| Contains the node value. Available for all nodes except |
| |
|
corresponding to an absolute URL. | By invocation, the node details are returned. Response type after invocation depending on the meta type.
Example:
|
|
|
| Contains the foreign key or enumeration label in the current locale. The default label is returned if the current locale is not supported. |
|
|
| Contains the node's inheritance state, considering only dataset inheritance. |
|
|
| Contains the node's field inheritance state, considering dataset and field inheritance. When both inheritances are used, field inheritance has priority over the dataset one. |
|
|
corresponding to an absolute URL. | Correspond to the URL for selector operation. Example:
|
|
|
| Contains the validation report that concerns the current node context. |
|
A simple field value is stored in a JSON object and the content is the value of the content
property.
XML Schema | JSON format | Examples | Meta type |
---|---|---|---|
|
| "A text" "The escape of \"special character\" is preceded by a backslash." "<p>An HTML tag can thus be written without trouble</p>" "employee@mycompany.com" null |
|
|
| "en-US" |
|
(Foreign key) |
contains the value of the formatted foreign key. |
|
|
|
| true false null |
|
|
| -10.5 20.001 15 -1e-13 |
|
|
| "2015-04-13" |
|
|
| "11:55:00" "11:55:00.000" |
|
|
| "2015-04-13T11:55:00" "2015-04-13T11:55:00.000" |
|
|
| "https://fr.wikipedia.org/wiki/René_Descartes" |
|
|
| 1596 |
|
|
contains the resource formatted value. | "ebx-tutorial:ext-images:frontpages/Ajax for Dummies.jpg" |
|
|
contains the formatted value for the color. | "#F6E0E0" |
|
|
contains the formatted value of the dataset name. | "ebx-tutorial" |
|
|
contains the formatted key value of the dataspace. | "Bebx-tutorial" |
|
XML Schema | JSON format | Examples | Meta type |
---|---|---|---|
Group
|
Contains a property per sub-node. | Example for a simple-occurrence group. { "road" : {"content" : "11 rue scribe"}, "zipcode" : {"content" : "75009"}, "country" : {"content" : "France"} } |
|
List
|
Contains an array of all field occurrences represented by a JSON Each object is represented as a node value. | Example for a multi-occurrence field of the [ {"content": 0}, {"content": 1}, {"content": 2}, {"content": 3} ] Example for a multi-occurrence group. [ { "content": { "road": {"content": "11 rue scribe"}, "zipcode": {"content": "75009"}, "country": {"content": "France"} } }, { "content": { "road": {"content": "711 Atlantic Ave"}, "zipcode": {"content": "MA 02111"}, "country": {"content": "United States"} } } ] | or
|
This feature allows returning a limited and parameterizable number of data. Pagination can be applied to data of the following types: records, association values, selection node values and selectors. A context named pagination
is returned only if it has been activated. This context allows browsing data similarly to the UI.
Pagination is activated by default.
Detailed information related to this context can be found hereafter:
JSON property | JSON format | Description | Required |
---|---|---|---|
|
| URL to access the first page. | Yes (**) |
|
| URL to access the previous page. | Yes (**) |
|
| URL to access the next page. | Yes |
|
| URL to access the last page. | Yes (**) |
(*) Only defines if data is available in this context and not in the response.
(**) Not present on selector.
By invoking the URL represented by the property selector
on a field that provides an enumeration, this returns a JSON Object
containing the properties:
rows
containing an Array
of JSON Object
where each one contains two entries, such as the returned content
that can be persisted and the corresponding label
. The list of possible items is established depending on the current context.
(Optional) pagination
containing pagination information (activated by default).
{ "rows": [ { "content": "F", "label": "feminine" }, { "content": "M", "label": "masculine" } ], "pagination": { "nextPage": null } }
When invoking the insert operation with a record table, it can optionally return a report. The report includes a JSON Object
that contains the following properties:
rows
contains a JSON Object
Array
, where each element corresponds to the result of a request element.
code
contains an int
of the JSON Number
type, and allows to know whether the record has been inserted or updated. This property is included if, and only if, the updateOrInsert
parameter is set to true
.
foreignKey
contains a string
of the JSON String
type, corresponding to the content to be used as a foreign key for this record. This property is included if, and only if, the parameter includeForeignKey
is set to true
.
label
contains a string
of the JSON String
type, and allows to retrieve the record label. This property is included if, and only if, the parameter includeLabel
is set to yes
.
details
containing a string
of the JSON String
type, corresponding to the resource URL. This property is included if, and only if, the parameter includeDetails
is set to true
.
{ "rows": [ { "code": 204, "foreignKey": "62", "label": "Claude Debussy", "details": "http://.../root/individu/62" }, { "code": 201, "foreignKey": "195", "label": "Camille Saint-Saëns", "details": "http://.../root/individu/195" } ] }
When invoking the delete operation, a report is returned. The report includes a JSON Object
that contains the following properties:
deletedCount
containing an integer of the JSON Number
type, corresponds to the number of deleted records.
occultedCount
containing an integer of the JSON Number
type, corresponds to the number of occulted records.
inheritedCount
containing an integer of the JSON Number
type, corresponds to the number of inherited records.
{ "deletedCount": 1, "occultedCount": 0, "inheritedCount": 0 }
Each returned record is completed with the properties corresponding to its technical data, containing:
JSON property | JSON format | Description | Required |
---|---|---|---|
|
| Creation date. | Yes |
|
| Creation user identifier. | Yes |
|
| Last update date. | Yes |
|
| Last update user identifier. | Yes |
{ ... "creationDate": "2015-12-24T19:00:53.158", "creationUser": "admin", "lastUpdateDate": "2015-12-25T00:00:00.001", "lastUpdateUser": "admin", ... }
The byDelta
mode allows to ignore data model elements that are missing from the JSON source document. This mode is enabled (by default) through RESTful operations. The following table summarizes the behavior of insert and update operations when elements are not included in the source document.
See the RESTful data services operations update and insert, as well as ImportSpec.setByDelta
in the Java API for more information.
State in the JSON source document | Behavior |
---|---|
The property does not exist in the source document | If the
If the The target field is set to one of the following values:
NoteThe user performing the import must have the required permissions to create or change the target field value. Otherwise, the operation will be aborted. |
The element is present and its value is | The target field is always set to |
The value of fields xs:date
, xs:time
and xs:dateTime
does not contain a time zone associated with the JSON-primitive type.