PHP library to connect to the publica.la API.
- PHP >= 8.0
- Composer
Add the following to composer.json
{
"require": {
"anibalealvarezs/publica-php": "*"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/anibalealvarezs/publica-php"
}
]
}
Install all composer dependencies using:
composer install
Or install it via GitHub
composer require anibalealvarezs/publica-php
require_once('/path/to/PublicaPHP/vendor/autoload.php');
$publica = new PublicaPHP\ApiClient();
$publica->setConfig([
'apiKey' => 'YOUR_API_KEY',
'url' => 'YOUR_URL', // https://your.domain
]);
$response = $publica->users->getAllUsers();
print_r($response);
The client library must be configured to use X-User-Token header parameter.
The APIClient class lets you set various configuration options like timeouts, host, user agent, and debug output.