2017 © Pedro Peláez
 

library flarum-api-client

Standalone package for calling the API of a Flarum installation.

image

flagrow/flarum-api-client

Standalone package for calling the API of a Flarum installation.

  • Monday, May 22, 2017
  • by Luceos
  • Repository
  • 5 Watchers
  • 17 Stars
  • 917 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 4 Open issues
  • 7 Versions
  • 2 % Grown

The README.md

flarum-api-client by flagrow logoflagrow

Latest Stable Version Gitter, (*1)

This is a generic PHP API client for use in any project. You can simply include this package as a dependency to your project to use it., (*2)

installation

composer require flagrow/flarum-api-client

configuration

In order to start working with the client you might need a Flarum master key:, (*3)

  1. Generate a 40 character random, unguessable string, this is the Token needed for this package.
  2. Manually add it to the api_keys table using phpmyadmin/adminer or another solution.

The master key is required to access non-public discussions and running actions otherwise reserved for Flarum administrators., (*4)

examples

A basic example:, (*5)

<?php

require_once "vendor/autoload.php";

use Flagrow\Flarum\Api\Flarum;

$api = new Flarum('http://example.com');

// A collection of discussions from the first page of your Forum index.
$discussions = $api->discussions()->request();
// Read a specific discussion.
$discussion = $api->discussions()->id(1)->request();
// Read the first page of users.
$users = $api->users()->request();

An authorized example:, (*6)

$api = Flarum('http://example.com', ['token' => '<insert-master-token>; userId=1']);

The userId refers to a user that has admin permissions or the user you want to run actions for. Appending the userId setting to the token only works for Master keys., (*7)

Flagrow is a collaboration of Flarum extension developers to provide quality, maintained extensions., (*8)

The Versions

22/05 2017

dev-master

9999999-dev

Standalone package for calling the API of a Flarum installation.

  Sources   Download

MIT

The Requires

 

The Development Requires

api flarum flagrow

04/03 2017

0.2.0-beta.2

0.2.0.0-beta2

Standalone package for calling the API of a Flarum installation.

  Sources   Download

MIT

The Requires

 

The Development Requires

api flarum flagrow

04/03 2017

0.2.0-beta.1

0.2.0.0-beta1

Standalone package for calling the API of a Flarum installation.

  Sources   Download

MIT

The Requires

 

The Development Requires

api flarum flagrow

04/03 2017

dev-new

dev-new

Standalone package for calling the API of a Flarum installation.

  Sources   Download

MIT

The Requires

 

The Development Requires

api flarum flagrow

22/01 2016

0.1.2

0.1.2.0

Standalone package for calling the API of a Flarum installation.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matteo Pompili

api flarum flagrow

22/01 2016

0.1.1

0.1.1.0

Standalone package for calling the API of a Flarum installation.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matteo Pompili

api flarum flagrow

22/01 2016

0.1.0

0.1.0.0

Standalone package for calling the API of a Flarum installation.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matteo Pompili

api flarum flagrow