printgraph / php-sdk
0.0.1
2024-03-02 02:14 UTC
Requires
- php: >=8.1
- guzzlehttp/guzzle: ^7.8
- prewk/result: ^3.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.51
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.0
README
Printgraph API v1 client library, written in PHP
Requirements
PHP 8.1 or later
Installation
$ composer req printgraph/php-sdk
Usage
<?php use Printgraph\PhpSdk\Api\Pdf\Generator\GenerateRequest; use Printgraph\PhpSdk\Client\ClientFactory; use Printgraph\PhpSdk\Printgraph; require 'vendor/autoload.php'; $pringraph = new Printgraph( ClientFactory::createHttpClient('<<your token>>') ); $request = new GenerateRequest( 'template', ['message' => 'Hello, World'] ); $response = $pringraph->pdf()->generate($request)->expect( new \RuntimeException('Failed to generate PDF') ); file_put_contents('test.pdf', $response->getBody()->getContents());