4.6 KiB
title | description | menu | weight | influxdb/cloud/tags | products | related | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
InfluxDB 1.x compatibility API | The InfluxDB v2 API includes InfluxDB 1.x compatibility endpoints that work with InfluxDB 1.x client libraries and third-party integrations like [Grafana](https://grafana.com) and others. |
|
104 |
|
|
|
The InfluxDB v2 API includes InfluxDB 1.x compatibility /write
and /query
endpoints that work with InfluxDB 1.x client libraries and third-party integrations
like Grafana and others.
View full v1 compatibility API documentation
Authentication
{{% cloud %}} InfluxDB Cloud requires all query and write requests to be authenticated using InfluxDB authentication tokens. {{% /cloud %}}
Use InfluxDB authentication tokens with the following authentication schemes:
Authenticate with the Token scheme
Token authentication requires the following credential:
- token: InfluxDB authentication token
Use the Authorization
header with the Token
scheme to provide your
token to InfluxDB.
Syntax
Authorization: Token <token>
Example
{{< code-tabs-wrapper >}} {{% code-tabs %}} curl Node.js {{% /code-tabs %}} {{% code-tab-content %}}
{{% get-shared-text "api/v1-compat/auth/oss/token-auth.sh" %}}
{{% /code-tab-content %}} {{% code-tab-content %}}
{{% get-shared-text "api/v1-compat/auth/oss/token-auth.js" %}}
{{% /code-tab-content %}} {{< /code-tabs-wrapper >}}
Authenticate with a username and password scheme
Use the following schemes with clients that support the InfluxDB 1.x convention of username and password (that don't support the Authorization: Token
scheme):
Manage credentials
Username and password schemes require the following credentials:
- username: InfluxDB Cloud username
- password: InfluxDB Cloud authentication token
Basic authentication
Use the Authorization
header with the Basic
scheme to provide username and password credentials to InfluxDB.
{{% api/v1-compat/basic-auth-syntax %}}
Syntax
Authorization: Basic <username>:<password>
Example
{{< code-tabs-wrapper >}} {{% code-tabs %}} curl Node.js {{% /code-tabs %}} {{% code-tab-content %}}
{{% get-shared-text "api/v1-compat/auth/oss/basic-auth.sh" %}}
{{% /code-tab-content %}} {{% code-tab-content %}}
{{% get-shared-text "api/v1-compat/auth/cloud/basic-auth.js" %}}
{{% /code-tab-content %}} {{< /code-tabs-wrapper >}}
Query string authentication
Use InfluxDB 1.x API parameters to provide username and password credentials through the query string.
{{% note %}}
Consider when using query string parameters
- URL-encode query parameters that may contain whitespace or other special characters.
- Be aware of the risks when exposing sensitive data through URLs. {{% /note %}}
Syntax
/query/?u=<username>&p=<password>
/write/?u=<username>&p=<password>
Example
{{< code-tabs-wrapper >}} {{% code-tabs %}} curl Node.js {{% /code-tabs %}} {{% code-tab-content %}}
{{% get-shared-text "api/v1-compat/auth/oss/querystring-auth.sh" %}}
{{% /code-tab-content %}} {{% code-tab-content %}}
{{% get-shared-text "api/v1-compat/auth/oss/querystring-auth.js" %}}
{{% /code-tab-content %}} {{< /code-tabs-wrapper >}}
InfluxQL support
The compatibility API supports InfluxQL, with the following caveats:
- The
INTO
clause (e.g.SELECT ... INTO ...
) is not supported. - With the exception of [
DELETE
](/{{< latest "influxdb" "v1" >}}/query_language/manage-database/#delete-series-with-delete) and [DROP MEASUREMENT
](/{{< latest "influxdb" "v1" >}}/query_language/manage-database/#delete-measurements-with-drop-measurement) queries, which are still allowed, InfluxQL database management commands are not supported.
Compatibility endpoints
{{< children readmore=true >}}