lasselehtinen / issuu
Issuu API client for PHP
Installs: 4 118
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 5
Forks: 6
Open Issues: 2
Requires
- php: ^8.2|^8.3
- guzzlehttp/guzzle: ~6.0|~7.0
Requires (Dev)
- php-parallel-lint/php-parallel-lint: ^1.4
- phpro/grumphp: ^1.4
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^11.1
- roave/security-advisories: latest-dev
- squizlabs/php_codesniffer: ^3.7
README
Issuu - API client for PHP
Notes
The version 3.0 is for the Issuu API v2. Old API was deprecated on May 1st, 2024.
Installation
You can install this package via composer using this command:
composer require lasselehtinen/issuu
Supported functionality
Drafts
Publications
Stacks
Stats
User
Usage
Creating a client
First create a new instance with your API key and secret:
use lasselehtinen\Issuu\Issuu; $issuu = new Issuu('apiKey'); $drafts = new Drafts($issuu); $body = [ 'confirmCopyright' => true, 'fileUrl' => 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf', 'info' => [ 'file' => 0, 'access' => 'PUBLIC', 'title' => 'Example title', 'description' => 'Description', 'preview' => false, 'type' => 'editorial', 'showDetectedLinks' => false, 'downloadable' => false, 'originalPublishDate' => '1970-01-01T00:00:00.000Z', ], ]; $createDraft = $drafts->create($body); // Try few times until the file is converted for ($i=0; $i < 10; $i++) { $draft = $drafts->getDraftBySlug($createDraft->slug); if ($draft->fileInfo->conversionStatus === 'DONE') { break; } sleep(2); } $publishDraftBySlug = $drafts->publishDraftBySlug($createDraft->slug, ['desiredName' => 'foobar']);
Contributing
Pull requests are welcome.
Pull Requests
- Use PSR-2 Coding Standard.
- Add tests! Your patch won't be accepted if it doesn't have tests.
- Document any change in behaviour. Make sure the
README.md
and any other relevant documentation are kept up-to-date. - Send coherent history. Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.
Running Tests
$ phpunit
Issues
If you have problems or suggestions, please open a new issue in GitHub.
License
The MIT License (MIT). Please see License File for more information.