InfluxDB Cloud 2.0

Has anybody tested using data in Influx CloudDB 2.0, and accessing data with their API? Are there any CORS issues etc causing problems?

Looking at the API docs very briefly, it looks like the API works with just an auth token header: https://v2.docs.influxdata.com/v2.0/reference/api/ so it should work out of the box. Let us know how it goes!

For testing purposes, you can just define the auth header in the REST API integration config, but for a secure production app, you’d want some external backend service that lets users authenticate against itself, provide a user-specific auth token and keep the master auth token in the backend.

Content type for the replies from Influx Cloud 2.0 is only csv. Would that work with Composer or does it need to be JSON?

At the moment all the packaged functions expect a JSON reply. All the rest of the data structures in Composer apps work with JSON format data, so the CSV reply anyway would anyway need to be converted to JSON at some point.

However, https://v2.docs.influxdata.com/v2.0/api/ would indicate JSON responses? Where did you get CSV responses only?

It seems (at least with curl) that response is as csv even if requested as json. All the examples are with csv so haven’t seen yet if that actually works? I was first testing with curl before testing Composer Data access.

So including Accept: application/json header in the curl command still causes the response to be CSV? Very weird. In any case, debugging this falls outside Composer support scope, so I’d suggest posting your curl command to StackOverflow, someone there can surely help!

So it looks like, confirmed by https://community.influxdata.com/t/receive-flux-query-results-in-json-format-via-http-api/12079

Right, then at the moment the appropriate thing would be to set up a separate backend to parse the CSV into JSON.