# REST Api smil example ?

**URL:** <https://community.wowza.com/t/rest-api-smil-example/417>\
**Category:** Wowza Developer Dojo\
**Created:** [June 22, 2015, 4:39am UTC](https://community.wowza.com/t/rest-api-smil-example/417 "2015-06-22T04:39:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)\
**Post date:** [June 22, 2015, 4:39am UTC](https://community.wowza.com/t/rest-api-smil-example/417/1 "2015-06-22T04:39:34Z")

</div>

Hello,

I’m trying to create smil file with the REST API (wowza 4.2).

I follow the instruction here : [https://www.wowza.com/docs/how-to-use-curl-to-query-wowza-rest-api](https://www.wowza.com/docs/how-to-use-curl-to-query-wowza-rest-api)

and I managed to create a new application without problem.

But I can’t create a smil file with this call :

POST /v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/smilfiles/{smilfileName}

```auto
{
    "restURI": "http://XX.XX.XX.XX:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/cdn/smilfiles/myfile",
    "serverName": "",
    "smilStreams": [
        {
            "systemLanguage": "en",
            "dur": "",
            "ngrp": "",
            "keyFrameOnly": "",
            "src": "myfile_750.mp4",
            "systemBitrate": "",
            "serverName": "",
            "videoCodecId": "",
            "type": "video",
            "version": "",
            "audioBitrate": "44100",
            "audioCodecId": "",
            "videoBitrate": "750000",
            "restURI": "",
            "isWowzaCaptionStream": "",
            "videoOnly": "",
            "audioOnly": "",
            "width": "640",
            "saveFieldList": [],
            "idx": 0,
            "begin": "",
            "wowzaCaptionIngestType": "",
            "height": "360"
        },
        {
            "systemLanguage": "en",
            "dur": "",
            "ngrp": "",
            "keyFrameOnly": "",
            "src": "myfile_1100.mp4",
            "systemBitrate": "",
            "serverName": "",
            "videoCodecId": "",
            "type": "video",
            "version": "",
            "audioBitrate": "44100",
            "audioCodecId": "",
            "videoBitrate": "1100000",
            "restURI": "",
            "isWowzaCaptionStream": "",
            "videoOnly": "",
            "audioOnly": "",
            "width": "1272",
            "saveFieldList": [],
            "idx": 1,
            "begin": "",
            "wowzaCaptionIngestType": "",
            "height": "720"
        }
    ],
    "saveFieldList": [],
    "title": "myfile",
    "version": "1434975987"
}

```

I have this result

```auto
{"success":false,"message":null,"data":null}

```

Can you provide a working example of this call please ?

Thanks

---

<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:** [June 30, 2015, 8:58am UTC](https://community.wowza.com/t/rest-api-smil-example/417/2 "2015-06-30T08:58:39Z")

</div>

Hello

You’ll want to ensure you define the restURI and be case sensative. Here was a quick test that was successful for me (testing against 4.2.0)

```auto
curl -X POST --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles/mytestsmil -d'
{
   "restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles/mytestsmil",
   "smilStreams": [
         {
            "systemLanguage": "en",
            "src": "myfile_750.mp4",
            "systemBitrate": "50000",
            "type": "video",
            "audioBitrate": "44100",
            "videoBitrate": "750000",
            "restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles/mytestsmil",
            "width": "640",
            "height": "360"
        },
        {
            "systemLanguage": "en",
            "src": "myfile_1100.mp4",
            "systemBitrate": "50000",
            "type": "video",
            "audioBitrate": "44100",
            "videoBitrate": "1100000",
            "restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles/mytestsmil",
            "width": "640",
            "height": "360"
        }
        ]
}'

```

Thanks,

Matt

---

<div class="post-metadata">

**Author:** ![Bouchard\_Julien](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@Bouchard\_Julien](https://community.wowza.com/u/Bouchard_Julien)\
**Post date:** [July 15, 2015, 12:47pm UTC](https://community.wowza.com/t/rest-api-smil-example/417/3 "2015-07-15T12:47:43Z")

</div>

Hello,

Thanks Matt !

Your example is working for me.

It seems that systemBitrate is a mandatory field

---

<div class="post-metadata">

**Author:** ![Lisa\_Wong](https://avatars.discourse-cdn.com/v4/letter/l/34f0e0/32.png) [@Lisa\_Wong](https://community.wowza.com/u/Lisa_Wong)\
**Post date:** [April 12, 2016, 7:54am UTC](https://community.wowza.com/t/rest-api-smil-example/417/4 "2016-04-12T07:54:32Z")

</div>

Hello Carlos,

I saw your [other post](http://community.wowza.com/t/-/46117) and replied there. I’ll also reach out directly.

-Lisa

---

<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:** [March 25, 2016, 9:18am UTC](https://community.wowza.com/t/rest-api-smil-example/417/5 "2016-03-25T09:18:17Z")

</div>

What version of Wowza are you using? Ensure you are on the latest and that the smil file doesn’t already exist. Restart Wowza and try again. If the problem remains, please zip up your conf/ and logs/ and include your curl command and result in a ticket submitted [here](https://www.wowza.com/portal/help/engine).

Thanks,

Matt

---

<div class="post-metadata">

**Author:** ![David\_Casado](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@David\_Casado](https://community.wowza.com/u/David_Casado)\
**Post date:** [March 18, 2016, 5:50am UTC](https://community.wowza.com/t/rest-api-smil-example/417/6 "2016-03-18T05:50:39Z")

</div>

Hello

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

{

“restURI”: “[http://localhost:8087/v2/servers/](http://localhost:8087/v2/servers/)_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles/mytestsmil”,

“smilStreams”: [

{

“systemLanguage”: “en”,

“src”: “myfile\_750.mp4”,

“systemBitrate”: “50000”,

“type”: “video”,

“audioBitrate”: “44100”,

“videoBitrate”: “750000”,

“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”: “myfile\_1100.mp4”,

“systemBitrate”: “50000”,

“type”: “video”,

“audioBitrate”: “44100”,

“videoBitrate”: “1100000”,

“restURI”: “[http://localhost:8087/v2/servers/](http://localhost:8087/v2/servers/)_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles/mytestsmil”,

“width”: “640”,

“height”: “360”

}

]

}’

output:

{“success”:false,“message”:“null/mytestsmil.smil (No such file or directory)”,“data”:null}

path error.How can I solve this problem?

---

<div class="post-metadata">

**Author:** ![Carlos\_Camacho](https://avatars.discourse-cdn.com/v4/letter/c/d26b3c/32.png) [@Carlos\_Camacho](https://community.wowza.com/u/Carlos_Camacho)\
**Post date:** [April 10, 2016, 12:58am UTC](https://community.wowza.com/t/rest-api-smil-example/417/7 "2016-04-10T00:58:41Z")

</div>

Hello,

Can you check this?

> [@OpenSource Wowza Server SDK on wowza.io](http://community.wowza.com/t/-/46117):
>
> Hello, I just have created a small OpenSource project stored on Github, this is related to a open SDK writen in PHP, Python and .Net to be able to create simpler streaming apps. The first version includes, for now only the PHP version. FUNCTIONALITIES: Create plain live application. Create secured live application. Delete live application. Delete all live applications. Get live applications list. Get live application configuration. In the PHP version is also integrated a …

There is a good/working example there using PHP.

Cheers
