# Wowza Access to Api does not work

**URL:** <https://community.wowza.com/t/wowza-access-to-api-does-not-work/49773>\
**Category:** Wowza Developer Dojo\
**Created:** [September 27, 2017, 1:52pm UTC](https://community.wowza.com/t/wowza-access-to-api-does-not-work/49773 "2017-09-27T13:52:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Umut\_Tufanoglu1](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Umut\_Tufanoglu1](https://community.wowza.com/u/Umut_Tufanoglu1)\
**Post date:** [September 27, 2017, 1:52pm UTC](https://community.wowza.com/t/wowza-access-to-api-does-not-work/49773/1 "2017-09-27T13:52:54Z")

</div>

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](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:

```auto
'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:

```auto
$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

```auto
$server = new \Com\Wowza\Server($setup);

```

```auto
$sf = new \Com\Wowza\Statistics($setup);

```

```auto
$response = $sf->getServerStatistics($server);

```

```auto
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.

---

<div class="post-metadata">

**Author:** ![Michelle\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/michelle_b/32/394_2.png) [@Michelle\_B](https://community.wowza.com/u/Michelle_B)\
**Post date:** [September 30, 2017, 1:58am UTC](https://community.wowza.com/t/wowza-access-to-api-does-not-work/49773/2 "2017-09-30T01:58:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Umut\_Tufanoglu1](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Umut\_Tufanoglu1](https://community.wowza.com/u/Umut_Tufanoglu1)\
**Post date:** [October 4, 2017, 7:30am UTC](https://community.wowza.com/t/wowza-access-to-api-does-not-work/49773/3 "2017-10-04T07:30:02Z")

</div>

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

```auto
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

```

---

<div class="post-metadata">

**Author:** ![Umut\_Tufanoglu1](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Umut\_Tufanoglu1](https://community.wowza.com/u/Umut_Tufanoglu1)\
**Post date:** [October 4, 2017, 8:17am UTC](https://community.wowza.com/t/wowza-access-to-api-does-not-work/49773/4 "2017-10-04T08:17:20Z")

</div>

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](http://kopy.io) snippet)

```auto
https://kopy.io/vCHFn

```

---

<div class="post-metadata">

**Author:** ![Umut\_Tufanoglu1](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Umut\_Tufanoglu1](https://community.wowza.com/u/Umut_Tufanoglu1)\
**Post date:** [October 10, 2017, 9:57am UTC](https://community.wowza.com/t/wowza-access-to-api-does-not-work/49773/5 "2017-10-10T09:57:18Z")

</div>

Hi again,

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

---

<div class="post-metadata">

**Author:** ![Umut\_Tufanoglu1](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Umut\_Tufanoglu1](https://community.wowza.com/u/Umut_Tufanoglu1)\
**Post date:** [October 10, 2017, 9:57am UTC](https://community.wowza.com/t/wowza-access-to-api-does-not-work/49773/6 "2017-10-10T09:57:56Z")

</div>

Did you already have a look at the xml content?
