Skip to content

Latest commit

 

History

History
67 lines (48 loc) · 1.84 KB

README.md

File metadata and controls

67 lines (48 loc) · 1.84 KB

Publica-PHP

Github tag GitHub license Github all releases GitHub latest commit Ask Me Anything !

About

PHP library to connect to the publica.la API.


Requirements

  • PHP >= 8.0
  • Composer

Installation

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

Quick Start

Note that this SDK requires PHP 8.0 or above.

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);

Authentication Method

The client library must be configured to use X-User-Token header parameter.

Other configuration options

The APIClient class lets you set various configuration options like timeouts, host, user agent, and debug output.