Wowza Community

Wowza Access to Api does not work

Hi,

I am trying to use the Wowza Api for Wowza streaming engine.
I installed this library https://github.com/WowzaMediaSystems/wse-rest-library-php with composer.
I set up the constants for the config and created the setup programming but somehow it returns me null.

These are currently my constants:

'WOWZA_HOST', 'http://35.158.34.28:8088',
'WOWZA_URL' => '35.158.34.28','WOWZA_PORT' => '8088','WOWZA_SERVER_INSTANCE' => '_defaultServer_','WOWZA_VHOST_INSTANCE' => '_defaultVHost_','WOWZA_USERNAME' => 'wowza','WOWZA_PASSWORD' => 'mypassword'The config should be ok, but I am not sure what to insert to WOWZA_SERVER_INSTANCE AND WOWZA_VHOST_INSTANCE

The config should be ok, but I am not sure what to insert to WOWZA_SERVER_INSTANCE AND WOWZA_VHOST_INSTANCE

The php setup looks like this:

$setup = new \Com\Wowza\Entities\Application\Helpers\Settings();
$setup->setHost($host); 
$setup->setUsername($username);
$setup->setPassword($password);// Connect to the server or deal with statistics NOTICE THE CAPS IN COM AND WOWZA

$server = new \Com\Wowza\Server($setup);
$sf = new \Com\Wowza\Statistics($setup);
$response = $sf->getServerStatistics($server);
$setup->setPassword($password);

// Connect to the server or deal with statistics NOTICE THE CAPS IN COM AND WOWZA

$server = new \Com\Wowza\Server($setup);
$sf = new \Com\Wowza\Statistics($setup);
$response = $sf->getServerStatistics($server);

var_dump($response); // this returns NULL

I am not sure what I am missing, the namespaces should be correct, I get no error with them.
Furthermore we are using AWS to run the streaming engine thus I use the php framework laravel if that makes a difference.

Hi,

When querying the Wowza Streaming Engine REST API, you should be using port 8087, or whichever port is configured in your conf/Server.xml RESTInterface. Port 8088 by default is used to access your Manager UI. Please try changing your constants to use port 8087 and see if you continue to run into an issue.

Michelle

Hi I changed to port to 8087, and my I get following output if I var_dump($response):

JSON REQUEST to http://35.158.34.28:8087/servers/_defaultServer_/monitoring/historic with verb GET: {"restURI":"http:\/\/35.158.34.28:8087\/servers\/_defaultServer_\/monitoring\/historic","settings":{}} RETURN: NULL

I checked my conf/Server.xml and the port is 8087 but it still does not work.

My conf/Server.xml looks like this:
(I could not paste the xml here since it exceeds the number of characters to I create a kopy.io snippet)

https://kopy.io/vCHFn

Hi again,

I posted a copy of the xml file in my server and further information did you already have a look at it ? :slight_smile:

Did you already have a look at the xml content?