cloudflare / cloudflare-php

PHP library for the Cloudflare v4 API
BSD 3-Clause "New" or "Revised" License
621 stars 222 forks source link

Invalid request headers #65

Closed william1888 closed 6 years ago

william1888 commented 6 years ago

According to my sentry logs about 2 weeks ago I started getting this error:

"code":6003,"message":"Invalid request headers",

The error happens on this code:

$zones = new \Cloudflare\API\Endpoints\Zones($this->adapter);
$zones->getZoneID($domain);

The code was working fine for half a year before that, I have the latest version of this package and php 7.2.8.

I can see the full request URL in my error log, when I try that URL in my desktop REST client together with the X-Auth-Email and X-Auth-Key headers then it works fine, so I am not sure what the problem might be?

themazim commented 6 years ago

Having the same issue, what's your solution?

Edit:

For those of you having the same issue, double check your credentials, I mistakenly copied only a part of my API key.

georgezee commented 3 years ago

In my case I had set CF_API_EMAIL, which lead to the above errors, but using only CF_API_KEY worked fine.