# REST API start up stream example

**URL:** <https://community.wowza.com/t/rest-api-start-up-stream-example/45471>\
**Category:** Wowza Developer Dojo\
**Created:** [October 26, 2015, 3:43pm UTC](https://community.wowza.com/t/rest-api-start-up-stream-example/45471 "2015-10-26T15:43:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yu\_Han](https://avatars.discourse-cdn.com/v4/letter/y/ccd318/32.png) [@Yu\_Han](https://community.wowza.com/u/Yu_Han)\
**Post date:** [October 26, 2015, 3:43pm UTC](https://community.wowza.com/t/rest-api-start-up-stream-example/45471/1 "2015-10-26T15:43:35Z")

</div>

I did the following request use REST API, but it returns this error: The server encountered an unexpected condition which prevented it from fulfilling the request.

I am quite not so sure what to write in two restURI. Helps please.

{

“restURI”: “[http://localhost:8087/v2/servers/](http://localhost:8087/v2/servers/)_defaultServer_/vhosts/_defaultVHost_/startupstreams”,

“serverName”: “”,

“saveFieldList”: [

“”

],

“version”: “”,

“Streams”: [

{

“restURI”: “[http://localhost:8087/v2/servers/](http://localhost:8087/v2/servers/)_defaultServer_/vhosts/_defaultVHost_/startupstreams”,

“mediaCasterType”: “rtp”,

“instance”: “”,

“serverName”: “”,

“saveFieldList”: [

“”

],

“version”: “”,

“streamName”: “main2.stream”,

“applicationName”: “544299-1”

}

]

}

---

<div class="post-metadata">

**Author:** ![Yu\_Han](https://avatars.discourse-cdn.com/v4/letter/y/ccd318/32.png) [@Yu\_Han](https://community.wowza.com/u/Yu_Han)\
**Post date:** [October 26, 2015, 5:45pm UTC](https://community.wowza.com/t/rest-api-start-up-stream-example/45471/2 "2015-10-26T17:45:43Z")

</div>

It should like this, but it still have the same error.

Request URL: “[http://localhost:8087/v2/servers/](http://localhost:8087/v2/servers/)_defaultServer_/vhosts/_defaultVHost_/startupstreams”

And body: {

“restURI”: “[http://localhost:8087/v2/servers/](http://localhost:8087/v2/servers/)_defaultServer_/vhosts/_defaultVHost_/startupstreams”,

“version”: “1445839700752”,

“Streams”: [

{

“restURI”: “[http://localhost:8087/v2/servers/](http://localhost:8087/v2/servers/)_defaultServer_/vhosts/_defaultVHost_/startupstreams/applications/544299-1/instances/_definst_/streams/main2.stream”,

“mediaCasterType”: “liverepeater”,

“instance”: “_definst_”,

“streamName”: “main2.stream”,

“applicationName”: “544299-1”

}

]

}

---

<div class="post-metadata">

**Author:** ![Matt\_Young](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/matt_young/32/389_2.png) [@Matt\_Young](https://community.wowza.com/u/Matt_Young)\
**Post date:** [October 29, 2015, 8:42am UTC](https://community.wowza.com/t/rest-api-start-up-stream-example/45471/3 "2015-10-29T08:42:19Z")

</div>

Hello

You might try the following example:

```auto
curl -X POST --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://[B][wowza-server][/B]:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/startupstreams -d'{
   "appName": "[B][app-name][/B]", 
   "mediaCasterType": "rtp",
   "instance": "_definst_",
   "serverName": "_defaultServer_",
   "streamName": "[B][stream-file-name][/B]",
   "version": "1446125518000"
 }'

```

This returned successful for me:

```auto
{"success":true,"message":"Saved","data":null}

```

Ensure you replace the following:

**[wowza-server]** - with your wowza url (ex. localhost)

**[app-name]** - with your app name (ex. 544299-1)

**[stream-file-name]** - with your stream file name (ex. main2.stream)

Thanks,

Matt

---

<div class="post-metadata">

**Author:** ![Yu\_Han](https://avatars.discourse-cdn.com/v4/letter/y/ccd318/32.png) [@Yu\_Han](https://community.wowza.com/u/Yu_Han)\
**Post date:** [October 27, 2015, 10:51am UTC](https://community.wowza.com/t/rest-api-start-up-stream-example/45471/4 "2015-10-27T10:51:06Z")

</div>

It’s java.lang.ArrayIndexOutOfBoundsException.

finaly I can add a start up stream one item at a time, it’s enough for me.

but I still wonder I did add array right.

---

<div class="post-metadata">

**Author:** ![Menno\_Prakken](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@Menno\_Prakken](https://community.wowza.com/u/Menno_Prakken)\
**Post date:** [October 16, 2017, 5:32pm UTC](https://community.wowza.com/t/rest-api-start-up-stream-example/45471/5 "2017-10-16T17:32:12Z")

</div>

You can try with the following CURL command

**LIST**  **Startup Streams**

```auto
curl -X GET --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://[B][wowza-server][/B]:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/startupstreams

```

**ADD** Startup Stream

```auto
curl -X POST --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://[B][wowza-server][/B]:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/startupstreams -d'{
   "appName": "demo", 
   "mediaCasterType": "rtp",
   "instance": "_definst_",
   "serverName": "_defaultServer_",
   "streamName": "ip.stream"
 } 

```

**MODIFY** Startup Stream

```auto
curl -X PUT --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://[B][wowza-server][/B]:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/startupstreams/applications/demo/instances/_definst_/streams/ip.stream -d'{
   "appName": "demo", 
   "mediaCasterType": "rtp",
   "instance": "_definst_",
   "serverName": "_defaultServer_",
   "streamName": "anotherip.stream"
}' 

```

**DELETE** Startup Stream

```auto
curl -X DELETE --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://[B][wowza-server][/B]:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/startupstreams/applications/demo/instances/_definst_/streams/ip.stream

```

---

<div class="post-metadata">

**Author:** ![Avantia\_Tecnologia\_e](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@Avantia\_Tecnologia\_e](https://community.wowza.com/u/Avantia_Tecnologia_e)\
**Post date:** [November 22, 2019, 2:57pm UTC](https://community.wowza.com/t/rest-api-start-up-stream-example/45471/6 "2019-11-22T14:57:47Z")

</div>

These API calls are not documented in the official guide. It’s frustrating to have to find Wowza’s information by luck.
