Getting started
The format of the query language is either JSON or YAML. For simplicity, this example starts with a basic query and builds from there.
Select the Id and Name for all communities as a flat list. The object representing the query is called ViewConfig, as it defines a particular view, which is a selection of the data. The object containing the graph part of the query is called Resources.
The following example shows the Community entity along with its Id and Name properties.
{
"ViewConfig": {
"Resources": {
"Community": {
"name": "Communities", <---\
"Id": { "name": "community id" }, ---- a node can (or must) have a name. Thus the community own 'name' property must be uppercased to avoid conflicts.
"Name": { "name": "community name" } <---/
}
}
}
}---
ViewConfig:
Resources:
Community:
name: "Communities" <---\
Id: ---- a node can (or must) have a name. Thus the community own 'name' property must be uppercased to avoid
name: "community id"
Name: <---/
name: "community name"Test the API
To test the API, use a REST client, such as the Postman plugin for Chrome. Many output formats are available, but the JSON tree is the format that most resembles the query.
This example uses the following endpoint on the OutputView resource:
{{domain}}/rest/2.0/outputModule/export/json
Use a POST call with the following body.
The output is formatted as an array of communities.
You can use the ViewConfig queries with the following endpoints:
{{domain}}/rest/2.0/outputModule/export/{{xml | json}}{{domain}}/rest/2.0/outputModule/export/{{xml | json}}-file{{domain}}/rest/2.0/outputModule/export/{{xml | json}}-job
Last updated
Was this helpful?