A PHP Matrix API using cURL.
src | ||
.gitignore | ||
composer.json | ||
README.md |
cURL
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: