# SMIL FILE GENERATE WITH REST API

**URL:** <https://community.wowza.com/t/smil-file-generate-with-rest-api/54621>\
**Category:** Wowza Developer Dojo\
**Created:** [February 10, 2020, 3:46pm UTC](https://community.wowza.com/t/smil-file-generate-with-rest-api/54621 "2020-02-10T15:46:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![developer\_goplaybook](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@developer\_goplaybook](https://community.wowza.com/u/developer_goplaybook)\
**Post date:** [February 10, 2020, 3:46pm UTC](https://community.wowza.com/t/smil-file-generate-with-rest-api/54621/1 "2020-02-10T15:46:42Z")

</div>

**I am trying to create a smil file with REST API.**  
**this is my CURL request:**

curl -X POST -H ‘Accept:application/json; charset=utf-8’ -H ‘Content-Type:application/json; charset=utf-8’ --digest --user ‘ **:** ’ [http://localhost:8087/v2/servers/](http://localhost:8087/v2/servers/)_defaultServer_/vhosts/_defaultVHost_/applications/live/instances/smilfiles/mytestsmil -d

{  
“restURI”: “[http://localhost:8087/v2/servers/](http://localhost:8087/v2/servers/)_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles/mytestsmil”,  
“title” =\> “apiTest”,  
“smilStreams”: [  
{  
“systemLanguage”: “en”,  
“src”: “myStream\_160.mp4”,  
“systemBitrate”: “50000”,  
“type”: “video”,  
“audioBitrate”: “44100”,  
“videoBitrate”: “64000”,  
“restURI”: “[http://localhost:8087/v2/servers/](http://localhost:8087/v2/servers/)_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles/mytestsmil”,  
“width”: “640”,  
“height”: “480”  
},{  
“systemLanguage”: “en”,  
“src”: “myStream\_360.mp4”,  
“systemBitrate”: “50000”,  
“type”: “video”,  
“audioBitrate”: “44100”,  
“videoBitrate”: “850000”,  
“restURI”: “[http://localhost:8087/v2/servers/](http://localhost:8087/v2/servers/)_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles/mytestsmil”,  
“width”: “640”,  
“height”: “360”  
}, {  
“systemLanguage”: “en”,  
“src”: “myStream\_160.mp4”,  
“systemBitrate”: “50000”,  
“type”: “video”,  
“audioBitrate”: “44100”,  
“videoBitrate”: “200000”,  
“restURI”: “[http://localhost:8087/v2/servers/](http://localhost:8087/v2/servers/)_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles/mytestsmil”,  
“width”: “284”,  
“height”: “160”  
}]  
}’

**RESPONSE:**

{“success”:false,“wowzaServer”:“4.7.8”,“message”:“The server has not found anything matching the request URI”,“code”:“404”}

**let me know for any clue,**

**Thanks**

---

<div class="post-metadata">

**Author:** ![Amara\_Graham](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/amara_graham/32/381_2.png) [@Amara\_Graham](https://community.wowza.com/u/Amara_Graham)\
**Post date:** [February 10, 2020, 10:30pm UTC](https://community.wowza.com/t/smil-file-generate-with-rest-api/54621/2 "2020-02-10T22:30:23Z")

</div>

If you are creating the smilfile, the URI should not include the name. Supply the smilfile name in the body as part of the SMILFileAppConfig.

```auto
/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/smilfiles

```

---

<div class="post-metadata">

**Author:** ![developer\_goplaybook](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@developer\_goplaybook](https://community.wowza.com/u/developer_goplaybook)\
**Post date:** [February 11, 2020, 8:51am UTC](https://community.wowza.com/t/smil-file-generate-with-rest-api/54621/3 "2020-02-11T08:51:37Z")

</div>

Thanks Amara,

I was following this tutorial to create smil file "

[https://www.wowza.com/docs/smil-files-query-examples](https://www.wowza.com/docs/smil-files-query-examples)" may be its outdated.

Can you share with me detailed request data example to generate smil file ? As i am unable to locate.

---

<div class="post-metadata">

**Author:** ![Amara\_Graham](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/amara_graham/32/381_2.png) [@Amara\_Graham](https://community.wowza.com/u/Amara_Graham)\
**Post date:** [February 11, 2020, 3:00pm UTC](https://community.wowza.com/t/smil-file-generate-with-rest-api/54621/4 "2020-02-11T15:00:20Z")

</div>

My mistake. I was looking at the wrong call in the API reference. Your URI appears to be correct. I’ll have to take a closer look at this.

Here are steps to get the API reference running - [https://www.wowza.com/docs/how-to-access-documentation-for-wowza-streaming-engine-rest-api](https://www.wowza.com/docs/how-to-access-documentation-for-wowza-streaming-engine-rest-api)

---

<div class="post-metadata">

**Author:** ![Amara\_Graham](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/amara_graham/32/381_2.png) [@Amara\_Graham](https://community.wowza.com/u/Amara_Graham)\
**Post date:** [February 11, 2020, 3:21pm UTC](https://community.wowza.com/t/smil-file-generate-with-rest-api/54621/5 "2020-02-11T15:21:47Z")

</div>

Quick update here. I was able to run the request from the API reference and I was also able to run the example from the link you referenced in a simple bash script, both successfully. When I run your code, I do see the same error. Going to dig in and see what is different with your code.

---

<div class="post-metadata">

**Author:** ![Amara\_Graham](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/amara_graham/32/381_2.png) [@Amara\_Graham](https://community.wowza.com/u/Amara_Graham)\
**Post date:** [February 11, 2020, 4:58pm UTC](https://community.wowza.com/t/smil-file-generate-with-rest-api/54621/6 "2020-02-11T16:58:57Z")

</div>

Your URI is incorrect,

```auto
http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/instances/smilfiles/mytestsmil

```

should be (remove instances)

```auto
http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles/mytestsmil

```

Remove this line, = is unexpected in JSON

```auto
"title" => "apiTest",

```
