webCOMAND

API

Use the API to query and search Bases, and enable secure web services.

API View

cQuery

To perform a query in cPath, cQL or cQuery, add a new "cQuery" tab from the "+" menu at the top, then enter a query and click Process (Ctrl+Enter).

Click "Options" to adjust any of the following options.

  • Run As - The user to run the query as.  Results will be restricted to the selected user's authorizations.
  • Query Mode - Query for objects in a select workflow state: Working Copy, Drafts or Active.
  • Return Mode - Return results as objects or rows.  For more information, see cQL vs SQL.

Results

Results are displayed in a table.  If Objects are returned, the selected object fields are flattened into a table with one row per object.  If Rows are returned, certain queries may return multiple rows for a single object.

Click the Queries button to display the cQL queries that are performed to process the query.  For example, multiple cQL queries are often performed to process a cPath query.  Click a cQL query on the left to display the queries (usually SQL) performed on the repository storage engine (usually MySQL or MariaDB) along with timings.  This information can help with query optimization and debugging.

cTemplate

To execute cTemplate or cScript, add a new "cTemplate" tab from the "+" menu at the top, then enter cTemplate code and click Process (Ctrl+Enter).  To execute cScript, wrap the code in #CSCRIPT ... #ENDCSCRIPT.

Click "Options" to adjust any of the following options.

  • Run As - The user to run the cTemplate as.  Results will be restricted to the selected user's authorizations.
  • Query Mode - Query and load objects in a select workflow state: Working Copy, Drafts or Active.

Results

Results are displayed as HTML by default.  Click "Raw" to display the raw data (or HTML source).

Click the Compiled button to display the internal byte code the cTemplate is compiled to before it is processed.

Web Services

To perform a web service request, add a new "Web API Call" tab from the "+" menu at the top, select the web service, enter any web service parameters and click Process (Ctrl+Enter).

Most web services will require the selection of an Authorization Token.  If a token is not already available, you can create one with the Create button.

Click "Options" to adjust any optional parameters for the selected web service.  For information about the parameters for each web service, see the specific web service under web services.

Results

The response will be displayed in JSON format by default.  Click "Raw" to see the raw HTTP response body.

Click "Headers" to see the response HTTP headers.

Click "Snippets" to view and copy code to perform the same web service request from various scripting languages and APIs.

SQL

To perform an SQL query on the underlying storage engine (typically MySQL or MariaDB), add a new "SQL" tab from the "+" menu at the top, then enter a query and click Process (Ctrl+Enter).

Click "Explain" instead of "Process" to execute an EXPLAIN query and display the execution path.

Results

Results are displayed in a table.