# Create a live app You can use the Wowza Streaming Engineā„¢ REST API to create and manage applications in Wowza Streaming Engine [media server software](https://www.wowza.com/products/streaming-engine). This article shows how to use cURL to query the REST API to create and manage a live streaming application. > **Notes:** - Wowza Streaming Engine 4.3.0 or later is required. - PHP examples for the tasks in this article are available in the **tests** folder of the [PHP REST Library for Wowza Streaming Engine on GitHub](https://github.com/WowzaMediaSystems/wse-rest-library-php). ## Create an application Create an application for live streaming with Wowza Streaming Engine default settings. ```bash curl - X POST \ -H 'Accept:application/json; charset=utf-8' \ -H 'Content-Type:application/json; charset=utf-8' \ http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName} \ -d' { "restURI": "http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}", "name": "testlive", "appType": "Live", "clientStreamReadAccess": "*", "clientStreamWriteAccess": "*", "description": "A basic live application", "streamConfig": { "restURI": "http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/streamconfiguration", "streamType": "live" } }' ``` This example creates an application named *testlive*. ```bash curl - X POST \ -H 'Accept:application/json; charset=utf-8' \ -H 'Content-Type:application/json; charset=utf-8' \ http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/testlive \ -d' { "restURI": "http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/testlive", "name": "testlive", "appType": "Live", "clientStreamReadAccess": "*", "clientStreamWriteAccess": "*", "description": "A basic live application", "streamConfig": { "restURI": "http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/testlive/streamconfiguration", "streamType": "live" } }' ``` The command should return a response that looks something like this: ```json { "success": true, "message": "Application (testlive) created successfully." } ``` You could also create the application *testlive* with password authentication by adding *securityConfig* and *ModuleCoreSecurity* to the request: ```bash curl -X POST \ -H 'Accept:application/json; charset=utf-8' \ -H 'Content-Type:application/json; charset=utf-8' \ http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/testlive \ -d' { "restURI": "http://localhost:8087/v2/servers/(serverName}/vhosts/{vhostName}/applications/testlive", "name": "testlive", "appType": "Live", "description": "A live application with password authentication", "streamConfig": { "restURI": "http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/testlive/streamconfiguration", "streamType": "live" }, "securityConfig": { "restURI": "http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/testlive/security", "secureTokenVersion": 0, "clientStreamWriteAccess": "*", "publishRequirePassword": true, "publishPasswordFile": "", "publishRTMPSecureURL": "", "publishIPBlackList": "", "publishIPWhiteList": "", "publishBlockDuplicateStreamNames": false, "publishValidEncoders": "", "publishAuthenticationMethod": "digest", "playMaximumConnections": 0, "playRequireSecureConnection": false, "secureTokenSharedSecret": "", "secureTokenUseTEAForRTMP": false, "secureTokenIncludeClientIPInHash": false, "secureTokenHashAlgorithm": "", "secureTokenQueryParametersPrefix": "", "secureTokenOriginSharedSecret": "", "playIPBlackList": "", "playIPWhiteList": "", "playAuthenticationMethod": "none" }, "modules": { "restURI": "http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/testlive/modules", "moduleList": \[{ "order": 0, "name": "base", "description": "Base", "class": "com.wowza.wms.module.ModuleCore" }, { "order": 1, "name": "logging", "description": "Client Logging", "class": "com.wowza.wms.module.ModuleClientLogging" }, { "order": 2, "name": "flvplayback", "description": "FLVPlayback", "class": "com.wowza.wms.module.ModuleFLVPlayback" }, { "order": 3, "name": "ModuleCoreSecurity", "description": "Core Security Module for Applications", "class": "com.wowza.wms.security.ModuleCoreSecurity" }\] } }' ``` Here's how you would create the application *testlive* with password authentication and a live stream packetizer enabled: ```bash curl -X POST \ -H 'Accept:application/json; charset=utf-8' \ -H 'Content-Type:application/json; charset=utf-8' \ http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}\_/applications/testlive \ -d' { "restURI": "http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/testlive", "name": "testlive", "appType": "Live", "description": "A live application with password authentication and packetizers", "streamConfig": { "restURI": "http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/testlive/streamconfiguration", "streamType": "live", "liveStreamPacketizer": \[ "cupertinostreamingpacketizer" \] }, "securityConfig": { "restURI": "http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/testlive/security", "secureTokenVersion": 0, "clientStreamWriteAccess": "*", "publishRequirePassword": true, "publishPasswordFile": "", "publishRTMPSecureURL": "", "publishIPBlackList": "", "publishIPWhiteList": "", "publishBlockDuplicateStreamNames": false, "publishValidEncoders": "", "publishAuthenticationMethod": "digest", "playMaximumConnections": 0, "playRequireSecureConnection": false, "secureTokenSharedSecret": "", "secureTokenUseTEAForRTMP": false, "secureTokenIncludeClientIPInHash": false, "secureTokenHashAlgorithm": "", "secureTokenQueryParametersPrefix": "", "secureTokenOriginSharedSecret": "", "playIPBlackList": "", "playIPWhiteList": "", "playAuthenticationMethod": "none" }, "modules": { "restURI": "http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/testlive/modules", "moduleList": \[ { "order": 0, "name": "base", "description": "Base", "class": "com.wowza.wms.module.ModuleCore" }, { "order": 1, "name": "logging", "description": "Client Logging", "class": "com.wowza.wms.module.ModuleClientLogging" }, { "order": 2, "name": "flvplayback", "description": "FLVPlayback", "class": "com.wowza.wms.module.ModuleFLVPlayback" }, { "order": 3, "name": "ModuleCoreSecurity", "description": "Core Security Module for Applications", "class": "com.wowza.wms.security.ModuleCoreSecurity" }\] } }' ``` ## Update an application's settings Update the application: ```bash curl -X PUT \ -H 'Accept:application/json; charset=utf-8' \ -H 'Content-Type:application/json; charset=utf-8' \ http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}' ``` Update the application *testlive* to include the MPEG-DASH packetizer: ```bash curl -X PUT \ -H 'Accept:application/json; charset=utf-8' \ -H 'Content-Type:application/json; charset=utf-8' \ http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/testlive \ -d' { "restURI": "http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/testlive", "name":" testlive", "appType": "Live", "streamConfig": { "restURI": "http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/testlive/streamconfiguration", "streamType": "live", "liveStreamPacketizer": \[ "cupertinostreamingpacketizer", "mpegdashstreamingpacketizer" \] } }' ``` The command should return a response that looks something like this: ```bash { "success": true, "message": "Saved" } ``` ## Add custom properties to an application Update the *testlive* application to include a custom module called *MyCustomModule*: ```bash curl -X PUT \ -H 'Accept:application/json; charset=utf-8' \ -H 'Content-Type:application/json; charset=utf-8' \ http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/testlive/adv \ -d' { "restURI": "http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/testlive/adv", "version": "1430682096000", "modules": \[ { "order": 0, "name": "base", "description": "Base", "class": "com.wowza.wms.module.ModuleCore" }, { "order": 0, "name": "logging", "description": "Client Logging", "class": "com.wowza.wms.module.ModuleClientLogging" }, { "order": 0, "name": "flvplayback", "description": "FLVPlayback", "class": "com.wowza.wms.module.ModuleFLVPlayback" }, { "order": 0, "name": "ModuleDRMVerimatrix", "description": "ModuleDRMVerimatrix", "class": "com.wowza.wms.drm.module.verimatrix.ModuleDRMVerimatrix" }, { "order": 0, "name": "ModuleDRMBuyDRM", "description": "ModuleDRMBuyDRM", "class": "com.wowza.wms.drm.module.buydrm.ModuleDRMBuyDRM" }, { "order": 0, "name": "ModulePushPublish", "description": "Module Push Publish", "class": "com.wowza.wms.pushpublish.module.ModulePushPublish" }, { "order": 0, "name": "MyCustomModule", "description": "Module Custom Module", "class": "com.my.custom.path.MyCustomModule" }\], "advancedSettings": \[ { "enabled": false, "canRemove": true, "name": "debugAACTimecodes", "value": "false", "defaultValue": "false", "type": "Boolean", "sectionName": "cupertinostreamingpacketizer", "section": "/Root/Application/LiveStreamPacketizer", "documented": true }, { "enabled": false, "canRemove": true, "name": "debugMP3Timecodes", "value": "false", "defaultValue": "false", "type": "Boolean", "sectionName": "cupertinostreamingpacketizer", "section": "/Root/Application/LiveStreamPacketizer", "documented": true }, { "enabled": false, "canRemove": true, "name": "cupertinoChunkDurationTarget", "value": "0", "defaultValue": "10000", "type": "Integer", "sectionName": "cupertinostreamingpacketizer", "section": "/Root/Application/LiveStreamPacketizer", "documented": true }, { "enabled": true, "canRemove": false, "name": "myCustomPropertyName", "value": "myValue", "defaultValue": null, "type": "String", "sectionName": "Application", "section": "/Root/Application", "documented": false }\] }' ``` The result is that your application's configuration includes the following custom modules and properties: ```xml base Base com.wowza.wms.module.ModuleCore logging Client Logging com.wowza.wms.module.ModuleClientLogging flvplayback FLVPlayback com.wowza.wms.module.ModuleFLVPlayback ModuleDRMVerimatrix ModuleDRMVerimatrix com.wowza.wms.drm.module.verimatrix.ModuleDRMVerimatrix ModuleDRMBuyDRM ModuleDRMBuyDRM com.wowza.wms.drm.module.buydrm.ModuleDRMBuyDRM ModulePushPublish Module Push Publish com.wowza.wms.pushpublish.module.ModulePushPublish MyCustomModule Module Custom Module com.my.custom.path.MyCustomModule myCustomPropertyName myValue String ``` ## Restart an application Restart an application: ```bash curl -X PUT \ -H 'Accept:application/json; charset=utf-8' \ http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/actions/restart ``` ## Get a list of applications Get a list of all applications on an instance of Wowza Streaming Engine: ```bash curl -X GET \ -H 'Accept:application/json; charset=utf-8' \ http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications ``` The command should return a response that looks something like this: ```json { "restURI": "http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications", "applications": [ { "id": "live", "href": "http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/live", "appType": "Live", "dvrEnabled": false, "drmEnabled": false, "transcoderEnabled": false }, { "id": "vod", "href": "http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/vod", "appType": "VOD", "dvrEnabled": false, "drmEnabled": false, "transcoderEnabled": false } ] } ```