Pentaho CTools
Data IntegrationBusiness AnalyticsData CatalogData QualityLLM
  • Overview
    • CTools
  • C-Tools
    • Getting Started
      • First Steps
      • My First Dashboard
    • Community Data Access
      • Creating a CDA
        • Parameters
        • CDA API
        • CDA Data Sources
    • Community Dashboard Framework
      • CDF Dashboard
      • CDF Dashboards
    • Community Dashboard Editor
      • UI Overview
        • Carrier Dashboard
      • Components
        • Carrier Dashboard
    • Community Graphics Generator
      • Carrier Dashboard
  • Use Cases
Powered by GitBook
On this page

Was this helpful?

  1. C-Tools
  2. Community Data Access
  3. Creating a CDA

CDA API

CDA API Reference ..

PreviousParametersNextCDA Data Sources

Last updated 6 months ago

Was this helpful?

Understanding the API allows you to leverage CDA (Community Data Access) to integrate data with external applications. This capability is particularly valuable when you're not using CDE (Community Dashboard Editor) or CDF (Community Dashboard Framework) for dashboard development.

The API integration with CTools provides enhanced functionality through CDA's Web API interface. To make requests, use this base URL structure:

$BASE_URL/$WEBAPP/plugin/cda/api/

Where:

• $BASE_URL represents the protocol, hostname, and port

• $WEBAPP is the Apache Tomcat web application name (default is 'pentaho')

Here's a sample URL demonstrating a query to the pentaho webapp:


APIs

The getCdaList endpoint will get a list of all the CDA files available inside the repository. There is no need to specify the parameters for this endpoint.

To retrieve all available queries from a CDA file, use the listQueries endpoint.

Parameters:

path (required): Specifies the location of the CDA file to analyze

outputType (optional): Sets the response format

• Default: json

• Alternative: xml

http:/localhost:8080/pentaho/plugin/cda/
api/listQueries?path=/public/CTools-Dashboard/CDA/sampledata-queries.cda

This endpoint retrieves all parameters defined within a specified query.

Required Parameters:

path: The location of the CDA file containing the query definitions

dataAccessId: The identifier of the specific query to examine

Optional Parameters:

outputType: The desired format for the response

• Default: json

• Alternative: xml

The method executes a query and returns its results. It requires two mandatory parameters:

path: Specifies which file contains both:

• The connection settings

• The query to be executed

dataAccessId: Identifies which data access definition from the CDA file should be used. This definition links to a connection that was previously configured (as covered in the previous chapter).

When using parameters in your query, include them in the URL as paramParameter, where "Parameter" is replaced with the actual parameter name.

Optional Parameters:

outputType: Controls the format of the returned results

• Default: json

• Other formats: xml, csv, xls, html

Query Pagination and Parameters in CDA

Basic Pagination

To implement pagination in your queries, use these parameters:

paginateQuery (Boolean): Enable/disable pagination

pageStart: Starting row number

pageSize: Number of rows per page

Additional Query Parameters

bypassCache (Boolean): When set to true, forces a fresh database request instead of using cached data

sortBy: Specify column(s) for sorting results

This method will open the CDA previewer.

This method will open the CDA editor for a particular query. We should define a parameter with the path to the CDA file. The parameter is path.

http://localhost:8080/pentaho/plugin/cda/api/doQuery?dataAccessId=top50Customers&path=/public/CTools-Dashboard/CDA/sampledata-queries.cdalocalhost
http://localhost:8080/pentaho/plugin/cda/api/getCdaListlocalhost
http://localhost:8080/pentaho/plugin/cda/api/listParameters?dataAccessId=top50Customers&path=/public/CTools-Dashboard/CDA/sampledata-queries.cdalocalhost
http://localhost:8080/pentaho/plugin/cda/api/previewQuery?dataAccessId=top50Customers&path=/public/CTools-Dashboard/CDA/sampledata-queries.cdalocalhost
http://localhost:8080/pentaho/plugin/cda/api/editFile?path=/public/CTools-Dashboard/CDA/sampledata-queries.cdalocalhost
Edit CDA