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
.
Step 2: Create API basic information
Click the Create a Data Service
button.
Set the name, table, description, URL Path and Cache of the 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
Step 3: Set Parameters, Validation rules, Response Columns
Click the +
button to add Parameter.
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.
Click the Add Operation
button to add an Operator. One parameter can have multiple Operators.
Set Response column
Step 4: Simulate API query results
The system will simulate the API query results based on your settings in the previous steps
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.
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.
When using Customize SQL, enter parameters to preview simulated query results
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
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.
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 Parameter | Operator | Validation Rules-1 | Validation Rules-2 | Validation Rules-3 |
---|---|---|---|---|
Boolean | eq(=) | x | x | x |
Integer, Fixed-precision, Floating-point | equal to (eq) | Max, Min | x | x |
greater than(gt) | x | x | x | |
greater | than and equal to (gte) | x | x | x |
less than (lt) | x | x | x | |
less than and equal to (lte) | x | x | x | |
String | equal to (eq) | Max, Min | Format (Regex Pattern) | enum |
like | Max, Min | Format (Regex Pattern) | x | |
in | Max, Min | Format (Regex Pattern) | x | |
Date | equal to (eq) | Format(YYYY-MM-DD) | x | x |
greater than(gt) | Format(YYYY-MM-DD) | x | x | |
greater than and equal to (gte) | Format(YYYY-MM-DD) | x | x | |
less than (lt) | Format(YYYY-MM-DD) | x | x | |
less than and equal to (lte) | Format(YYYY-MM-DD) | x | x | |
Timestamp | equal to (eq) | Format(YYYY-MM-DD HH:mm:ss) | x | x |
greater than(gt) | Format(YYYY-MM-DD HH:mm:ss) | x | x | |
greater than and equal to (gte) | Format(YYYY-MM-DD HH:mm:ss) | x | x | |
less than (lt) | Format(YYYY-MM-DD HH:mm:ss) | x | x | |
less than and equal to (lte) | Format(YYYY-MM-DD HH:mm:ss) | x | x |