Hello all,
I have coded a first draft of a PHP class to interact with YunoHost API: https://github.com/scith/yunohost-api-php
This can be used to manage YunoHost entirely from a PHP page or application (such as a portal to create users).
The Github details different examples such as:
Return the list of users
require(“ynh_api.class.php”);
$ynh = new YNH_API(“YunoHost server IP or hostname”, “admin password”);
if ($ynh->login()) {
$users = $ynh->get("/users");
print_r($users);
} else {
print(“Login to YunoHost failed.\n”);
exit;
}
Everything presented here can be done with this PHP class: List of API functions
At the moment it is quite rudimentary: you need to get, post, put, delete manually.
I plan to integrate all API functions later on.
Anyone interested to test and use?
Thanks