Unauthorization

I’ve tried to configure grafana data source using created apis and buckets.

I’ve tried several values on several fields, but it’s not able to reach my influx service.

After that, I’ve tried to reach it from my host, using curl command:

I mean,

  1. I’ve created a bucket.
  2. I’ve created and read-write api token.

I’m trying to reach it using:

curl -s -G http://influxdb.localhost:8000/query -H "Authorization: OqtV6cpnwBlp4QEX1QDYx3xR6n6YPJstmgP084p8zP3rZeWrWYlvnMqKmLyIVuFsN684ToiqIfZS9flVz128Ag==" --data-urlencode "q=SHOW DATABASES" | jq .                                                                                                                ─╯
{
  "code": "unauthorized",
  "message": "unauthorized access"
}

Also, I’ve tried:

curl -s -G http://influxdb.localhost:8000/query -u admin:OqtV6cpnwBlp4QEX1QDYx3xR6n6YPJstmgP084p8zP3rZeWrWYlvnMqKmLyIVuFsN684ToiqIfZS9flVz128Ag== --data-urlencode "q=SHOW DATABASES" | jq .                                                                                                                           ─╯
{
  "code": "unauthorized",
  "message": "Unauthorized"
}

I don’t quite figure out what’s wrong.

I’ve tried with admin’s api token as well, but unauthorization response keeps.

Any ideas?

Hi @Jordi_Cabre,
Welcome to the community! You are close with your first attempt:

curl --location --request POST 'http://192.168.1.220:8086/api/v2/query/analyze?orgID=K8' \
--header 'Accept: application/json' \
--header 'Authorization: Token 6drVj04fG1cLeqjlMaAuVdtMPk5PgysbenRZQLoDxCFXbEQnh0JSe_qZAqY0heC1tEppabB3s7lrrIiME2XEvQ==' \

Have you checked out our postman project?GitHub - InfluxCommunity/postman_influx_v2_api: This repository provides an export of the InfluxDB API postman project. This gives you a sandbox interface to learn the API.