cloudflare-docs icon indicating copy to clipboard operation
cloudflare-docs copied to clipboard

Cloudflare Images API use batch_token results in authentication errors

Open twodft opened this issue 1 year ago • 0 comments

Existing documentation URL(s)

https://developers.cloudflare.com/images/upload-images/images-batch/

What changes are you suggesting?

The documentation suggests obtaining a BATCH_TOKEN via the images/v1/batch_token endpoint for various API requests.

After getting your token, you can use it to make requests for:

However, in my testing, using the suggested BATCH_TOKEN for these API endpoints results in authentication errors, specifically:

{
  "success": false,
  "errors": [
    {
      "code": 10000,
      "message": "Authentication error"
    }
  ]
}

In contrast, when using a CLOUDFLARE_API_TOKEN, the authentication process succeeds, and I receive a successful response.

Actually, those API endpoints works while use BATCH_TOKEN for auth

  • For listing images V2: https://batch.imagedelivery.net/images/v2
  • For uploading images V1: https://batch.imagedelivery.net/images/v1

Additional information

I have also submit a post in the community, at https://community.cloudflare.com/t/cloudflare-images-batch-api-not-work-for-doc-api-endpoint/634841

twodft avatar Mar 28 '24 08:03 twodft