Skip to main content
Version: v3

Data Services

Data Service makes it easier for you to build custom and performant APIs.

Through Data Service API, you can easily convert tables in Canner Workspace into high-performant and custom APIs. You can quickly create APIs by simply using No-code interface.

Data Service configuration process steps

Step 1: Enter Data Service page

First, in the sidebar, select the workspace in which you want to create the Data Service. After selecting, enter the tab page of Data Services.

1_data_service_step1

Step 2: Create API basic information

Click the Create a Data Service button.

2_data_service

Set the name, table, description, URL Path and Cache of the Data Service.

3_data_service

Click the Cache button to display the configurable Cache schedule

  • Scheduled update time: you can choose to never repeat or update periodically
  • Update Period: you can choose minutes, hours, days, weeks time units

4_data_service

Step 3: Set Parameters, Validation rules, Response Columns

Click the + button to add Parameter.

5_data_service

6_data_service

Set Parameter, Operator and corresponding Validation Rules

  • Required: indicates whether it is a required parameter
  • Operator: API Parameters Fetch data condition options. (General API only provides equal to)
  • Validation Rules: API Parameters validation conditions. When the user fills in parameter values ​​that do not meet the condition rules, an error will be returned. You can select multiple verification conditions. If a parameter has multiple conditions, all conditions must be met at the same time to successfully request the API.

Please see the Operator and corresponding Validation Rules section for more.

7_data_service

Click the Add Operation button to add an Operator. One parameter can have multiple Operators.

8_data_service

9_data_service

Set Response column

10_data_service

Step 4: Simulate API query results

The system will simulate the API query results based on your settings in the previous steps

SQL statement

At this stage, you can customize the query statement according to your own needs, but we strongly recommends that this operation is best performed by technical personnel. After customization, you need to return to the previous step to adjust the settings to the ones you just customized. The contents are consistent to avoid inconsistencies between the Data Service API and aut-generated API Docuementation.

SQL statement

Data Service API only supports conversion of a single table into API

In Customerize SQL, you can aggregate multiple tables, but the Data Service API only supports the conversion of a single table into an API.

Click the Select Parameters button and enter the parameters to simulate the query.

Simulation preview

When using Customize SQL, enter parameters to preview simulated query results

api_step3-filter

Step 5: API setting completed

Return to the Data Services tab and you can see the Data Service API you just created.

  • Click View API Docs to open the API documentation tab and you can also download API documentation.
  • Edit and delete permissions, only for API creator and workspace owner

11_data_service

Data Consumer can only see data from Semantic layer

The semantic settings of the API inherit from the settings in source table, so the Data Consumer cannot see the API set as disabled in semantic.

Removing Data Service API creator

Data Service API permissions belong to the creator and workspace owner. Therefore, before removing the API creator's account, you must first transfer all APIs ownership to another account before removal.

Supported Parameter Operations and Validation Rules

Type of ParameterOperatorValidation Rules-1Validation Rules-2Validation Rules-3
Booleaneq(=)xxx
Integer, Fixed-precision, Floating-pointequal to (eq)Max, Minxx
greater than(gt)xxx
greaterthan and equal to (gte)xxx
less than (lt)xxx
less than and equal to (lte)xxx
Stringequal to (eq)Max, MinFormat (Regex Pattern)enum
likeMax, MinFormat (Regex Pattern)x
inMax, MinFormat (Regex Pattern)x
Dateequal to (eq)Format(YYYY-MM-DD)xx
greater than(gt)Format(YYYY-MM-DD)xx
greater than and equal to (gte)Format(YYYY-MM-DD)xx
less than (lt)Format(YYYY-MM-DD)xx
less than and equal to (lte)Format(YYYY-MM-DD)xx
Timestampequal to (eq)Format(YYYY-MM-DD HH:mm:ss)xx
greater than(gt)Format(YYYY-MM-DD HH:mm:ss)xx
greater than and equal to (gte)Format(YYYY-MM-DD HH:mm:ss)xx
less than (lt)Format(YYYY-MM-DD HH:mm:ss)xx
less than and equal to (lte)Format(YYYY-MM-DD HH:mm:ss)xx