PHPackages                             pnz/mattermost-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. pnz/mattermost-client

ActiveLibrary[API Development](/categories/api)

pnz/mattermost-client
=====================

Mattermost APi Client for PHP

0.1.0(8y ago)287.8k↓25%14MITPHPPHP ^7.0

Since Jul 10Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/thePanz/MattermostClient)[ Packagist](https://packagist.org/packages/pnz/mattermost-client)[ RSS](/packages/pnz-mattermost-client/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (4)Used By (0)

Mattermost API Client
=====================

[](#mattermost-api-client)

[![Latest Version](https://camo.githubusercontent.com/866082a9730e674bc3f3f0c5b3b9dd631e22464bf6e54ebca7b1d3d9689d7bcf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f74686550616e7a2f4d61747465726d6f7374436c69656e742e737667)](https://github.com/thePanz/MattermostClient/releases)[![Build Status](https://camo.githubusercontent.com/9492d786144ac2ac9fb581757fcbc9a2d0ef8fc84a0d5762ce5d72a43b987811/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f74686550616e7a2f4d61747465726d6f7374436c69656e742e737667)](https://travis-ci.org/thePanz/MattermostClient)[![Code Coverage](https://camo.githubusercontent.com/5dccb33cb6e9cbfba70f09003f21384534c4c97060072309b377d6ca4a61918c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f74686550616e7a2f4d61747465726d6f7374436c69656e742e737667)](https://scrutinizer-ci.com/g/thePanz/MattermostClient)[![Quality Score](https://camo.githubusercontent.com/64adc5360c358b74cdef70977bd70dbb46eade9cadd5d4bb0399403fc3411a0a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f74686550616e7a2f4d61747465726d6f7374436c69656e742e737667)](https://scrutinizer-ci.com/g/thePanz/MattermostClient)[![Total Downloads](https://camo.githubusercontent.com/dc1507ca8192adbc7861481a519053c18639a73d5a9cee795a711693316be84c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706e7a2f6d61747465726d6f73742d636c69656e742e737667)](https://packagist.org/packages/pnz/mattermost-client)

A PHP library providing a client for the REST API v4 of [Mattermost](https://www.mattermost.org).

This library allows developers to use Mattermost data as objects via a set of specific Models. Data related to Team, Channel, User, Posts and so on are converted to model objects to be easily used and manipulated. Error responses from the Mattermost API are also handled as specific domain exceptions.

Your IDE will be able to auto-complete and suggest model properties, thus lowering the barrier to start using the Mattermost APIs without reading the extensive API documentation.

Following the example of [Friends of Api](https://github.com/FriendsOfApi/boilerplate) this library allows developers to use and extend the `Hydrators` used to parse the API responses. Those are responsible to transform the JSON returned by the API into Models (by default) or into other response types.

Model `builders` are included to facilitate the creation/update of models via the API.

Refer to the [Changelog](https://github.com/thePanz/MattermostClient/blob/master/changelog.md) for the list of changes. The list of supported APIs endpoints are available in this [Google Spreadsheet](https://docs.google.com/spreadsheets/d/1mLH2aYC8mMv8sLf_mZWxW8H-67juDYJ9M8dCxwWXdf4/edit?usp=sharing) document.

Installation
------------

[](#installation)

**TL;DR**

```
composer require php-http/curl-client nyholm/psr7 php-http/message pnz/mattermost-client
```

This library does not have a dependency on Guzzle or any other library that sends HTTP requests. We use the awesome HTTPlug to achieve the decoupling. We want you to choose what library to use for sending HTTP requests. Consult this list of packages that support [php-http/client-implementation](https://packagist.org/providers/php-http/client-implementation)find clients to use. For more information about virtual packages please refer to [HTTPlug](http://docs.php-http.org/en/latest/httplug/users.html). Example:

```
composer require php-http/curl-client
```

You do also need to install a PSR-7 implementation and a factory to create PSR-7 messages (PSR-17 whenever that is released). You could use Nyholm PSR-7 implementation and factories from php-http:

```
composer require nyholm/psr7 php-http/message
```

Now you may install the library by running the following:

```
composer require pnz/mattermost-client
```

Usage example
-------------

[](#usage-example)

```
