Discussions

Ask a Question
Back to All

inventory api issue

Using the Inventory sample provided at https://developer.sellbrite.com/reference/inventory:

I supplied the username and password from my authentication credentials
I then copied the resulting code and saved it in a file which I called test.php, and transferred it to my server
Then I opened test.php in Firefox and received a blank screen
I then looked at the error_log, which reported the following:

[08-Aug-2022 16:42:58 UTC] PHP Fatal error: Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error: GET https://api.sellbrite.com/v1/inventory?limit=100&page=1 resulted in a 401 Unauthorized response:

HTTP Basic: Access denied.

' in /home/nknvkj3bfe4n/public_html/sellbrite/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113

Stack trace:

0 /home/nknvkj3bfe4n/public_html/sellbrite/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))

1 /home/nknvkj3bfe4n/public_html/sellbrite/vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Response))

2 /home/nknvkj3bfe4n/public_html/sellbrite/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array)

3 /home/nknvkj3bfe4n/public_html/sellbrite/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promise\Promise::Guzzle in /home/nknvkj3bfe4n/public_html/sellbrite/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 113

The path with the 401 error is provided in the sample.

If anyone is retrieving inventory, I'd appreciate your assistance.

Thank you,
Lynn