What version of Openfire do you use? User Service plugin is deprecated. You should use REST API plugin instead, if your Openfire version is 4.1.1 or newer.
I just installed the plugin on the same server and I’m having issues. Openfire and my hostname (xmpp.datatron.app) are on the same server. https://xmpp.datatron.network/api.php is my page that I’m trying to operate the api from. This code below is in api.php. It’s not showing any error whenever I load the api.php. It’s just not sending the request to the server.
<?php
include "vendor/autoload.php";
# Create the Openfire Rest api object
$api = new Gidkom\OpenFireRestApi\OpenFireRestApi;
# Set the required config parameters
$api->secret = "TWvMWEDFzJCmOOPkE";
$api->host = "xmpp.datatron.app";
$api->port = "9091"; # default 9090
$result = $api->addUser('Username', 'Password', 'Real Name', 'johndoe@domain.com');
# Check result if command is succesful
if($result['status']) {
# Display result
print_r($result['data']);
} else {
# Something went wrong
echo 'Error: ';
echo $result['data'];
}
?>