blua-blue / blua-blue-php-sdk
PHP SDK for blua.blue
Requires
- ext-json: *
- guzzlehttp/guzzle: ^6.4
Requires (Dev)
- phpunit/phpunit: ^8.4
This package is auto-updated.
Last update: 2021-03-01 00:28:06 UTC
README
Installation
composer require blua-blue/blua-blue-php-sdk
Usage
require __DIR__ . 'vendor/autoload.php'; $client = new BluaBlue\Client('userName', 'Password', 'https://my-blua-blue-installation.com/api.v1/'); $allArticles = $client->getArticleList();
Methods
Constructor
new Client($userName, $password, [$apiEndpoint])
The API endpoint defaults to https://blua.blue/api.v1/
getArticle($articleSlugOrID)
This method accepts either the unique ID or the unique article-slug of a particular article.
getArticleList([$offset = 0, $limit = 100, $author = null])
Without any properties, this method retrieves up to 300 articles.
If authenticated user is admin and no author is set: Any article
If authenticated user is not admin and no author is set: Any published article
If authenticated user equals $author OR authenticated user is admin: All articles of author
If authenticated user is not admin: All articles of given author with the status published
NOTE: at time of publishing offset & limit are not yet implemented in the official blua.blue repository