# Cloud query 308 error

**URL:** <https://community.influxdata.com/t/cloud-query-308-error/20008>\
**Category:** InfluxDB 2\
**Tags:** influxdb-cloud-2-0\
**Created:** [May 21, 2021, 3:20am UTC](https://community.influxdata.com/t/cloud-query-308-error/20008 "2021-05-21T03:20:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![echo](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@echo](https://community.influxdata.com/u/echo)\
**Post date:** [May 21, 2021, 3:20am UTC](https://community.influxdata.com/t/cloud-query-308-error/20008/1 "2021-05-21T03:20:15Z")

</div>

I’m new to all things influx, and have searched for similar posts, but have found none.

I am trying to create a curl query for my cloud influxdb bucket. When I go to my influxdb account, the url [europe-west1-1.gcp.cloud2.influxdata.com](http://europe-west1-1.gcp.cloud2.influxdata.com) shows up, so I assemble a curl command that starts with:  
curl -G ‘[http://europe-west1-1.gcp.cloud2.influxdata.com/api/v2](http://europe-west1-1.gcp.cloud2.influxdata.com/api/v2) …’  
but I get back:

308 Permanent Redirect ... Looking up the 308 error seems to indicate I'm using the wrong URL - how do I determine what the right URL would be? Thanks.

---

<div class="post-metadata">

**Author:** ![echo](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@echo](https://community.influxdata.com/u/echo)\
**Post date:** [May 21, 2021, 4:30pm UTC](https://community.influxdata.com/t/cloud-query-308-error/20008/2 "2021-05-21T16:30:44Z")

</div>

I was able to get all logged data for the last hour on v2 cloud using the following curl based query (from a cygwin prompt in my case):

curl --request POST   
[https://europe-west1-1.gcp.cloud2.influxdata.com/api/v2/query?org=MY\_ORG](https://europe-west1-1.gcp.cloud2.influxdata.com/api/v2/query?org=MY_ORG)  
–header ‘Authorization: Token MY\_TOKEN’   
–header ‘Accept: application/csv’   
–header ‘Content-type: application/vnd.flux’   
–data ‘from(bucket: “MY\_BUCKET”)  
|\> range(start: -1h)’

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [May 24, 2021, 7:30pm UTC](https://community.influxdata.com/t/cloud-query-308-error/20008/3 "2021-05-24T19:30:12Z")

</div>

Hello @echo,  
this might be helpful

> **[Use CLI to Access Flux REPL & Write a Regular CSV to InfluxDB Cloud](https://www.influxdata.com/blog/tldr-tech-tips-how-to-use-cli-locally-to-access-flux-repl-write-regular-csv-to-influxdb-cloud/)**
>
> In this post we share how to use the InfluxDB CLI with InfluxDB Cloud. This TL;DR assumes you have registered for an InfluxDB Cloud account.

Basically you have to:

1. install the cli locally  
[Downloads](https://portal.influxdata.com/downloads/)
2. create a cli configuration with your cloud account credentials  
[influx config create | InfluxDB Cloud Documentation](https://docs.influxdata.com/influxdb/cloud/reference/cli/influx/config/create/)
3. ta-da now you can use the cli to access your cloud account.
