# REST API - Creating an application works but can't stream until I manually restart the application

**URL:** <https://community.wowza.com/t/rest-api-creating-an-application-works-but-cant-stream-until-i-manually-restart-the-application/54358>\
**Category:** Wowza Developer Dojo\
**Tags:** rest-api\
**Created:** [December 19, 2019, 10:20pm UTC](https://community.wowza.com/t/rest-api-creating-an-application-works-but-cant-stream-until-i-manually-restart-the-application/54358 "2019-12-19T22:20:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Holmes](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@Matt\_Holmes](https://community.wowza.com/u/Matt_Holmes)\
**Post date:** [December 19, 2019, 10:20pm UTC](https://community.wowza.com/t/rest-api-creating-an-application-works-but-cant-stream-until-i-manually-restart-the-application/54358/1 "2019-12-19T22:20:33Z")

</div>

Title says it all. I can create an application and I can send an incoming stream to the rtmp url just fine. But I can’t get outgoing playback to work (404 not found) until I log into the UI (enginemanager) re-save the settings (without changing them) and restarting the application. Only after the save and restart will HLS playback start loading.

My php code that successfully creates the application:

```auto
            $url = "http://$publicIpAddress:8087/$this->wowzaEngineUrlPart/$siteName";
                $data = [
                    'restURI' => "http://$publicIpAddress:8087/$this->wowzaEngineUrlPart/$siteName/",
                    "name" => $siteName,
                    "appType" => "Live",
                    "clientStreamReadAccess" => "*",
                    "clientStreamWriteAccess" => "*",
                    "clientStreamWriteAccess" => "*",
                    "description" => "A basic live application",
                    "httpCORSHeadersEnabled" => true,
                    "streamConfig" => [
                      "restURI" => "http://$publicIpAddress:8087/$this->wowzaEngineUrlPart/$siteName/streamconfiguration/",
                      "streamType" => "live",
                    ],
                ];
                // use key 'http' even if you send the request to https://...
                $options = [
                    'http' => [
                        'header' => "Accept:application/json; charset=utf-8\r\n".
                                    "Content-Type:application/json; charset=utf-8\r\n",
                        'method' => 'POST',
                        'content' => json_encode($data),
                        'timeout' => 60,
                    ]
                ];

                $context = stream_context_create($options);
                $result = file_get_contents($url, false, $context);
                if ($result === FALSE) { /* Handle error */ }

```

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [December 20, 2019, 3:13pm UTC](https://community.wowza.com/t/rest-api-creating-an-application-works-but-cant-stream-until-i-manually-restart-the-application/54358/2 "2019-12-20T15:13:38Z")

</div>

You can use this to restart @Matt Holmes:

```auto
curl -X PUT \
-H 'Accept:application/json; charset=utf-8' \
[http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/testlive/actions/restart](http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/testlive/actions/restart)

```

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [December 20, 2019, 3:14pm UTC](https://community.wowza.com/t/rest-api-creating-an-application-works-but-cant-stream-until-i-manually-restart-the-application/54358/3 "2019-12-20T15:14:22Z")

</div>

More query examples here:

[https://www.wowza.com/docs/application-management-query-examples](https://www.wowza.com/docs/application-management-query-examples)

---

<div class="post-metadata">

**Author:** ![Matt\_Holmes](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@Matt\_Holmes](https://community.wowza.com/u/Matt_Holmes)\
**Post date:** [December 20, 2019, 3:26pm UTC](https://community.wowza.com/t/rest-api-creating-an-application-works-but-cant-stream-until-i-manually-restart-the-application/54358/4 "2019-12-20T15:26:08Z")

</div>

So is a restart supposed to be needed after a create call? If so why does the incoming stream work but the outgoing stream fail?

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [December 20, 2019, 3:32pm UTC](https://community.wowza.com/t/rest-api-creating-an-application-works-but-cant-stream-until-i-manually-restart-the-application/54358/5 "2019-12-20T15:32:12Z")

</div>

It sometimes has to do with outgoing packetizers being specified or not or custom properties when creating an application and those changes need to be saved in order for the packetizers/playback to work properly.
