-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to print by given example - 1 #7
Comments
Can you confirm what version of the client lib you are using? There is two releases at the moment "master" and "release/2.0.0-rc1". Can you also publish the code which is throwing the error so I can have a go at reproducing? |
Thanks support Team, I am using the master branch code. I have checked again my code and debuging it, I was wrong set api from printnode admin. Its type should be "restricted" but i have set it account. after change the type. My code working properly. Thanks |
Minor bump on this for @PrintNode-Pete Currently investigating PrintNode, (pro)active support from the company in GitHub would be a major plus... |
@holtkamp I hear you. A while back one of my colleagues did a lot of work on this API lib (adding support for some of our newer API endpoints and reworking some of the pain points) but IIRC it didn't get merged back into master because of some breaking API changes and a some missing docs. If you checkout the release/2.0.0 branch and view this https://github.com/PrintNode/PrintNode-PHP/blob/release/2.0.0/Examples/example-2-creating-your-first-printjob.php it works. This release is also on composer tagged 2.0.0-rc1. https://packagist.org/packages/printnode/printnode-php#2.0.0-rc1 We're hard at work at the moment finishing off a big-ish project (adding linux support into our client software) at the moment but I'll find some time this week to get this release polished up, docs completed and finally merged into master which is something long overdue. |
I am getting the same error Code
It runs before perfect now getting above error. |
You're getting a HTTP 401 Unauthorised error here which usually indicates a bad API key.
Can you email me the API key you're using?
Thanks,
Peter
…---- On Tue, 25 Jul 2017 11:37:06 +0200 pareshhp <[email protected]> wrote ----
I am getting the same error
Error
Fatal error: Uncaught RuntimeException: HTTP Error (401): Unauthorized in project\include\PrintNode\Request.php:605
Stack trace: #0 project\include\utils\utils.php(13259): PrintNode\Request->__call('getPrinters', '?limit=2000')
#1 project\modules\SalesOrder\createdocuments.php(1493): checkForPrintNodePrinterKey(Array)
Code
function checkForPrintNodePrinterKey($pnParams)
{
$printnodeAPIKey = $pnParams['printNodeApiKey'];
require_once('include/PrintNode/loader.php');
$credentials = new PrintNode\Credentials();
$credentials->setApiKey($printnodeAPIKey);
$request = new PrintNode\Request($credentials);
$printers = $request->getPrinters("?limit=2000"); // GET ERROR ON THIS LINE.
....
}
What is the issue ? How to solve it ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Thanks Peter !! |
Hi Support Team,
I have used your given instruction in example code, I am getting below error.
Catchable fatal error: Argument 1 passed to PrintNode\Request::__construct() must be an instance of PrintNode\Credentials, instance of PrintNode\ApiKey given, called in /var/www/html/printnode/examples/example-1-submitting-a-printjob.php on line 28 and defined in /var/www/html/printnode/examples/vendor/printnode/printnode-php/src/PrintNode/Request.php on line 85
But i fixed it by adding below code.
$credentials = new PrintNode\Credentials();
$credentials->setApiKey(PRINTNODE_APIKEY);
After added this code, I am getting another error:
Fatal error: Uncaught exception 'RuntimeException' with message 'HTTP Error (401): Unauthorized' in /var/www/html/printnode/examples/vendor/printnode/printnode-php/src/PrintNode/Request.php:597 Stack trace: #0 /var/www/html/printnode/examples/example-1-submitting-a-printjob.php(39): PrintNode\Request->__call('getComputers', Array) #1 /var/www/html/printnode/examples/example-1-submitting-a-printjob.php(39): PrintNode\Request->getComputers() #2 {main} thrown in /var/www/html/printnode/examples/vendor/printnode/printnode-php/src/PrintNode/Request.php on line 597
Please let me know what i am doing wrong and how cloud i run my basic example code.
Thanks
Lokendra Meena
The text was updated successfully, but these errors were encountered: