diff --git a/docs/en/15-programming/01-connect/09-rest-api.md b/docs/en/15-programming/01-connect/09-rest-api.md index e6da5318fec04992fb9c600cb5fc500e7b13570b..97e0e7a93857d8e94e5386c14e6ab3387623c303 100644 --- a/docs/en/15-programming/01-connect/09-rest-api.md +++ b/docs/en/15-programming/01-connect/09-rest-api.md @@ -1,7 +1,7 @@ --- -sidebar_label: REST API -title: REST API -description: Connect to TDengine Cloud Service through RESTful API +sidebar_label: REST and Schemaless +title: REST and Schemaless +description: Connect to TDengine Cloud Service through RESTful API or Schemaless --- @@ -40,9 +40,9 @@ $env:TDENGINE_CLOUD_URL="" -## Connect +## Usage -Please copy the code below to your editor and run it. +The TDengine REST API is based on standard HTTP protocol and provides an easy way to access TDengine. As an example, the code below is to construct an HTTP request with the URL, the token and an SQL command and run it with the command line utility `curl`. ```bash curl -L \ @@ -50,3 +50,29 @@ curl -L \ $TDENGINE_CLOUD_URL/rest/sql?token=$TDENGINE_CLOUD_TOKEN ``` +## Schemaless + +### InfluxDB Line Protocol + +You can use any client that supports the http protocol to access the RESTful interface address `${TDENGINE_CLOUD_URL}/influxdb/v1/write` to write data in InfluxDB compatible format to TDengine. The EndPoint is as follows: + +```text +/influxdb/v1/write?db=&token=${TDENGINE_CLOUD_TOKEN} +``` + +Support InfluxDB query parameters as follows. + +- `db` Specifies the database name used by TDengine +- `precision` The time precision used by TDengine + +Note: InfluxDB token authorization is not supported at present. Only Basic authorization and query parameter validation are supported. + +### OpenTSDB Json and Telnet Protocol + +You can use any client that supports the http protocol to access the RESTful interface address `${TDENGINE_CLOUD_URL}/opentsdb/v1/put` to write data in OpenTSDB compatible format to TDengine. The EndPoint is as follows: + +```text +/opentsdb/v1/put/json/?token=${TDENGINE_CLOUD_TOKEN} +/opentsdb/v1/put/telnet/?token=${TDENGINE_CLOUD_TOKEN} +``` +