iwalkalone/matrix-api

PHP library to interact with Matrix Servers API.

Installs: 63

Dependents: 0

Suggesters: 0

Security: 0

pkg:composer/iwalkalone/matrix-api

v1.2 2025-10-16 03:24 UTC

This package is not auto-updated.

Last update: 2025-10-30 03:44:09 UTC


README

Description

Library to interact with Matrix servers API.

Install

Install with composer:

composer require iwalkalone/matrix-api

Or a specific version:

composer require iwalkalone/matrix-api ^1.0

How to use it

Authenticate with user and password to obtain an access_token:

$data = \iwalkalone\MatrixAPI::Authenticate("https://127.0.0.1:80", "user", "pass");
if ($data['status'] == 1) {
    $access_token = $data['result']['access_token'];
} else {
    print_r($data['result']); // It contains the error message and error code
}

If you implement an Appservice you can use as_token as access_token in functions.

You can check API specs here:

https://spec.matrix.org/latest/