blua-blue/blua-blue-php-sdk

PHP SDK for blua.blue

1.0.0 2019-11-30 14:58 UTC

This package is auto-updated.

Last update: 2020-08-30 01:58:09 UTC


README

Build Status Test Coverage

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