'getting {"code":"unauthorized","message":"unauthorized access"} after using "query" http api for InfluxDB 2.0

I am trying to contact influxdb running on kubernetes. I am new on influxdb and I have just started using it. I used the query http API in the following way: curl "http://pod_ip_address/query?q=show+databases" , but the response is {"code":"unauthorized","message":"unauthorized access"}. Now I have just the user UI, so maybe the problem could be related to that. Does anybody know what could be the issue?



Solution 1:[1]

InfluxDB 2.0 requires authentication using an ORG and a Token. You can pass these as HTTP headers in your curl call as shown here: https://docs.influxdata.com/influxdb/v2.0/api-guide/api_intro/#authentication

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mhall119