Why cloudflare keeps on saying 400 bad request?

Hi,
I tried to send following request to cloudflare api
https://api.cloudflare.com/client/v4/zones/xxx/logs/received?start=2019-06-23T00:00:00Z&end=2019-06-23T00:59:59Z&fields=ClientIP,ClientRequestHost,ClientRequestURI,CacheResponseBytes,ClientRequestBytes,OriginIP,ClientCountry

var client = new RestClient
{
BaseUrl = new Uri(url)
};

var request = new RestRequest("", Method.GET);

request.AddHeader(“X-Auth-Email”, “[email protected]”);
request.AddHeader(“X-Auth-Key”, “c1a9xxx”);
request.AddHeader(“Content-Type”, “application/json”);

no matter how I try, I always got this error message:

  "code": 1010,
  "message": "auth.forbidden"

I am sure that I put the right email and key in. Was there anything I missed? Is it possible that my account doesn’t have permission to run this API query?

thanks

That’s an Enterprise plan feature. Are you on an Enterprise plan?

https://api.cloudflare.com/#logs-received-properties

1 Like

hi, I see.

Some of our sites are labelled “enterprise website”, and the one I queried is “business website”. So it means that site is not on enterprise plan?

thanks

Correct. And that would account for the 400 error.