docs-v2/shared/text/api/v2.0/auth/oss/token-auth.sh

11 lines
387 B
Bash

#######################################
# Use a token in the Authorization header
# to authenticate with the InfluxDB 2.x API.
#######################################
curl --get "http://localhost:8086/api/v2" \
--header "Authorization: Token YOUR_API_TOKEN" \
--header 'Content-type: application/json' \
--data-urlencode "db=mydb" \
--data-urlencode "q=SELECT * FROM cpu_usage"