Trying to query with curl

I’m trying to test the API-access to my influx cloud 2.0 data. I still cannot get the simple curl test to work. The curl is as follows (org and token not real)

curl “https://eu-central-1-1.aws.cloud2.influxdata.com/api/v2/query?org=lxxxxxxnd&bucket=sensors” -H “Authorization: Token JrV4yH0BxxxxxxxxxxxxxxxxxB8wA==” -H “Accept: application/csv” -H “Content-type: application/vnd.flux” -d “range(start: -12h)|> filter(fn: (r) => r.device == ‘AutotalliTemp’)”

I guess there is some simple misunderstanding here but what it might be?

Thanks.

Antti

That isn’t valid Flux, you’ll need from(bucket: "sensors") |>

So your curl would look like:

curl "https://eu-central-1-1.aws.cloud2.influxdata.com/api/v2/query?org=lxxxxxxnd" \
  -H "Authorization: Token JrV4yH0BxxxxxxxxxxxxxxxxxB8wA==" \
  -H "Accept: application/csv" \
  -H "Content-type: application/vnd.flux" \
  -d 'from(bucket: "sensors") |> range(start: -12h) |> filter(fn: (r) => r.device == "AutotalliTemp")'

Thanks. That seems to work, I initially got another error but that was simply question of wrong kind of quote character.