2017 © Pedro Peláez
 

library printermonk-php

A PHP Client for PrinterMonk to give your printer an API

image

printermonk/printermonk-php

A PHP Client for PrinterMonk to give your printer an API

  • Tuesday, February 7, 2017
  • by roaldwegh
  • Repository
  • 2 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PrinterMonk client for PHP

This is an open source PHP client for the PrinterMonk API, (*1)

Installation

Get it with composer, (*2)

composer require printermonk/printermonk-php

Example: get all printers

<?php

use PrinterMonk\PrinterMonkClient;
use PrinterMonk\Repositories\PrinterRepository;

require __DIR__ . '/vendor/autoload.php';

$apiKey = getenv('PRINTERMONK_API_KEY');  // Your PrinterMonk API key

$client = new PrinterMonkClient($apiKey);
$printers = PrinterRepository::all($client);

var_dump($printers);

Example: get a single printer

<?php

use PrinterMonk\PrinterMonkClient;
use PrinterMonk\Repositories\PrinterRepository;

require __DIR__ . '/vendor/autoload.php';

$apiKey = getenv('PRINTERMONK_API_KEY');  // Your PrinterMonk API key
$printerId = 'prtr_uniqueprinterkey';

$client = new PrinterMonkClient($apiKey);
$printer = PrinterRepository::find($printerId, $client);

var_dump($printer);

Example: send a new print job to PrinterMonk

<?php

use PrinterMonk\Entities\PrintJob;
use PrinterMonk\PrinterMonkClient;

require __DIR__ . '/vendor/autoload.php';

$apiKey = getenv('PRINTERMONK_API_KEY');  // Your PrinterMonk API key
$printerId = 'prtr_uniqueprinterkey';

$client = new PrinterMonkClient($apiKey);

$printJob = new PrintJob();
$printJob->printerId = $printerId;
$printJob->name = 'Example document';
$printJob->contentType = 'pdf';
$printJob->content = base64_encode(file_get_contents('example.pdf'));

$printJob->post($client);

The Versions

07/02 2017

dev-master

9999999-dev https://github.com/PrinterMonk/printermonk-php

A PHP Client for PrinterMonk to give your printer an API

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Roald Wegh

api php print printermonk

07/02 2017

v0.1.0

0.1.0.0 https://github.com/PrinterMonk/printermonk-php

A PHP Client for PrinterMonk to give your printer an API

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Roald Wegh

api php print printermonk