Response is blank when attempting to purge cache from zone when using API Token

Cache is not clearing, receiving a blank response from Cloudflare API when using API Token credentials to purge all files from a zone.

  1. Created an API Token granting Zone.Cache Purge

  2. Submit a CURL request (XXXXXXX represents API Token ID, ZZZZZZZZZ represents valid Zone ID):

curl -X POST “https://api.cloudflare.com/client/v4/zones/ZZZZZZZZZ/purge_cache” -H “Authorization: Bearer XXXXXXX” -H “Content-Type:application/json” --data ‘{“purge_everything”:true}’

This returns nothing.

  1. However, if we were to change the zone ID to an incorrect zone, we receive back a typical response:

{“success”:false,“errors”:[{“code”:7003,“message”:“Could not route to /zones/ZZZZZZZZZZ/purge_cache, perhaps your object identifier is invalid?”},{“code”:7000,“message”:“No route for that URI”}],“messages”:,“result”:null}

  1. According to the API reference (https://api.cloudflare.com/#zone-purge-all-files), permissions need are “#zone:edit” – I have added Zone.Zone (edit) to the API Token permissions, but still the same “blank” result.

Seems to me that the “blank” response indicates an issue with the Cloudflare response.

I’m sure Support would like to hear about this:
Login to Cloudflare and then contact Cloudflare Support by clicking on the Get More Help button.

Thanks for thesuggestion – I had missed that method.

As it turns out, the response headers are showing a status of 500.

HTTP/2 500
date: Thu, 25 Jul 2019 16:16:04 GMT
content-type: text/html; charset=UTF-8
set-cookie: __cfduid=d53c0318cc6a03e284f3141a810b9214c1564071364; expires=Fri, 24-Jul-20 16:16:04 GMT; path=/; domain=.Cloudflare.com; HttpOnly
cf-ray: 4fbf6fad1e9858e9-DFW
expect-ct: max-age=604800, report-uri=“https://report-uri.Cloudflare.com/cdn-cgi/beacon/expect-ct
served-in-seconds: 0.082
strict-transport-security: max-age=15780000; includeSubDomains
x-content-type-options: nosniff
x-envoy-upstream-service-time: 78
server: Cloudflare