You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi folks, I'm just getting started using your sdk. I attempted to write a small test script based on simple example. When I attempt to run it I get back a lot of error messages of which I have pasted below.
Error received:
PHP Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: GET https://api.cloudflare.com/client/v4/user resulted in a 400 Bad Request response:
{"success":false,"errors":[{"code":6003,"message":"Invalid request headers","error_chain":[{"code":6103,"message":"Inval (truncated...)
in /home/dev/repos/cwpdev/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
#0 /home/dev/repos/cwpdev/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create() #1 /home/dev/repos/cwpdev/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp{closure}() #2 /home/dev/repos/cwpdev/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler() #3 /home/dev/repos/cwpdev/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise{closure}() #4 /home/dev/repos/cwpdev/vendor/guzzlehttp/promises/src/Promise.php(246): GuzzleHttp\Promise\TaskQueue->run() #5 /home/dev/repos/cwpdev/ in /home/dev/repos/cwpdev/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 113
This is my code:
`<?php
require_once('vendor/autoload.php');
$key = new \Cloudflare\API\Auth\APIKey('xxxxx@xxxxx.com', 'xxxxx');
$adapter = new Cloudflare\API\Adapter\Guzzle($key);
$user = new \Cloudflare\API\Endpoints\User($adapter);
echo 'Your user ID is: ' . $user->getUserID() . PHP_EOL;
`
I have verified that I am using the correct email address and Api key for my account.
Any direction would be most appreciated.
The text was updated successfully, but these errors were encountered:
stussey
changed the title
400 Bad Request trying simple testscript.
400 Bad Request trying simple test script.
Jul 12, 2020
Hi folks, I'm just getting started using your sdk. I attempted to write a small test script based on simple example. When I attempt to run it I get back a lot of error messages of which I have pasted below.
Error received:
PHP Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error:
GET https://api.cloudflare.com/client/v4/user
resulted in a400 Bad Request
response:{"success":false,"errors":[{"code":6003,"message":"Invalid request headers","error_chain":[{"code":6103,"message":"Inval (truncated...)
in /home/dev/repos/cwpdev/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
#0 /home/dev/repos/cwpdev/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create()
#1 /home/dev/repos/cwpdev/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp{closure}()
#2 /home/dev/repos/cwpdev/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler()
#3 /home/dev/repos/cwpdev/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise{closure}()
#4 /home/dev/repos/cwpdev/vendor/guzzlehttp/promises/src/Promise.php(246): GuzzleHttp\Promise\TaskQueue->run()
#5 /home/dev/repos/cwpdev/ in /home/dev/repos/cwpdev/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 113
This is my code:
`<?php
require_once('vendor/autoload.php');
$key = new \Cloudflare\API\Auth\APIKey('xxxxx@xxxxx.com', 'xxxxx');
$adapter = new Cloudflare\API\Adapter\Guzzle($key);
$user = new \Cloudflare\API\Endpoints\User($adapter);
echo 'Your user ID is: ' . $user->getUserID() . PHP_EOL;
`
I have verified that I am using the correct email address and Api key for my account.
Any direction would be most appreciated.
The text was updated successfully, but these errors were encountered: