iwalkalone / matrix-api
PHP library to interact with Matrix Servers API.
v1.2
2025-10-16 03:24 UTC
Requires
- iwalkalone/curl: 1.1
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: