coimstark/mattermost

Php Wrapper to interact with Mattermost API https://api.mattermost.com/

1.3.0 2021-07-15 12:55 UTC

This package is auto-updated.

Last update: 2024-06-09 12:15:10 UTC


README

PHP wrapper for Mattermost Api

Installation

composer require coimstark/mattermost

Authentication

Authentication can be handled via username / password

$username = '';
$password = '';

$session = (new Session())
    ->fromLogin($username, $password);

Or it can be handled by using personal access tokens

$accessToken = '';

$session = (new Session())
    ->fromPersonalAccessToken($accessToken);

Now setup the client with the session you've just created:

$uri = ''; // Mattermost uri incl. port (f.e. https://mattermost.acme.com:443)
$client = new Client($session, $uri);

Examples

You can find examples for every single API request in examples

Teams
Users
Channels
Posts