InfluxDB v2 Cloud API authentification: "bucket not found"

I’m new to using APIs, but I’m already having a hard time to make the most basic example of the InfluxDB v2 Cloud API work. I set up a Cloud account, created a bucket, did some successful testing with the Python client and now wanted to switch over to using the API.

My starting point is the Authentification example here. I opened my terminal and wrote:

curl --request POST https://eu-central-1-1.aws.cloud2.influxdata.com/api/v2/write --header "Authorization: Token read_write_token_for_bucket" --data-urlencode "org=me@mail.ch" --data-urlencode "bucket=my_own_Bucket"

This gives me:

{"code":"not found","message":"bucket not found"}

I double and triple checked the bucket name and corresponding token.

Then, I switched to Postman and sent the same request. The result was the same 404.

What am I doing wrong here?

It works now. The parameters need to be sent as query params, which does not seem to be the case in the example:

curl --request POST "https://eu-central-1-1.aws.cloud2.influxdata.com/api/v2/write?bucket=newbucket&org=me@mail.ch" --header "Authorization: Token xxxTOKENxxx" 
2 Likes

Hello,
Placing this here as reference to anyone who stumbles across this: