cloudflare-docs
cloudflare-docs copied to clipboard
Cloudflare Images API use batch_token results in authentication errors
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:
- Uploading an image -
POST /images/v1 - Retrieving image details -
GET /images/v1/{identifier} - Updating an image -
PATCH /images/v1/{identifier} - Listing images V2 -
GET /images/v2 - Creating a direct upload URL V2 -
POST /images/v2/direct_upload
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