Open API
Introduction
CMS Open API provides public data interfaces for any frontend application to integrate with
Usage Example
- Web
- Node.js
- Shell
const axios = require("axios");
const env = "<Environment ID>";
const region = "<Region, e.g. ap-shanghai>";
const kitId = "<CMS Instance ID>";
const projectId = "<CMS Project Unique ID>";
const collectionId = "<CMS Collection Unique ID>";
const data = await axios.get(
`https://${env}.${region}.kits.tcloudbase.com/cms/${kitId}/v1/open-api/projects/${projectId}/collections/${collectionId}/contents?limit=10&offset=0`
);
const axios = require("axios");
const env = "<Environment ID>";
const region = "<Region, e.g. ap-shanghai>";
const kitId = "<CMS Instance ID>";
const projectId = "<CMS Project Unique ID>";
const collectionId = "<CMS Collection Unique ID>";
const data = await axios.get(
`https://${env}.${region}.kits.tcloudbase.com/cms/${kitId}/v1/open-api/projects/${projectId}/collections/${collectionId}/contents?limit=10&offset=0`
);
env="<Environment ID>" && \
region="<Region, e.g. ap-shanghai>" && \
kitId="<CMS Instance ID>" && \
projectId="<CMS Project Unique ID>" && \
collectionId="<CMS Collection Unique ID>" && \
curl "https://$env.$region.kits.tcloudbase.com/cms/$kitId/v1/open-api/projects/$projectId/collections/$collectionId/contents?limit=10&offset=0"
API List
Query Collection Content
Request method: GET
Request URL: https://${env}.${region}.kits.tcloudbase.com/cms/${kitId}/v1/open-api/projects/${Project ID}/collections/${Collection ID}/contents?limit=10&offset=0
Parameters
- Query parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
offset | number | No | 0 | Offset, starting from 0 |
limit | number | No | 30 | Number of data per page, maximum 100 |
Response
{
"code": "NORMAL",
"result":{
"data": IContent[],
"total": number
},
"requestId": ""
}
Query Single Record
Request method: GET
Request URL: https://${env}.${region}.kits.tcloudbase.com/cms/${kitId}/v1/open-api/projects/${Project ID}/collections/${Collection ID}/contents/${Content ID}
Parameters
None
Response
{
"code": "NORMAL",
"result":IContent,
"requestId": ""
}