RESTful API - Application Management - Storm Streaming Server

This section describes Storm’s RESTful API regarding application creation and management.

Get Application List

Request typeGET
URL/rest-api/applications
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"success",
   "data":{
      "applications":[
         {"name":"live", "type":"LIVE"},
         {"name":"origin", "type":"ORIGIN"},
      ]
   }
}
                                        
Table 1. Get application list table.

Field explanation:

applicationsList of all active applications.
applications:nameName of particular application.
applications:typeType of particular application (LIVE, EDGE, ORIGIN).
Table 2. Get application list fields table.

Get Application Info

Request typeGET
URL/rest-api/applications/${APPLICATION_NAME}
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"success",
   "data":{
      "name":"live",
      "type":"LIVE",
      "streamCount":1,
      "viewerCount":5,
      "outgoingBandwidth":15400,
      "incomingBandwidth": 681231,
      "startDate":1685526733
   }
}
                                        
Table 3. Get application info table.

Field explanation:

nameApplication name
typeApplication type, possible values: LIVE, EDGE, ORIGIN.
viewerCountNumber of active video streams.
viewerCountTotal number of viewers.
incomingBandwidthDownload speed for this application (all incoming streams).
outgoingBandwidthUpload speed for this application (all viewer connections).
startDateStart date for this application in Unix time.
Table 4. Get application info fields table.

Get Application Stream List

Request typeGET
URL/rest-api/applications/${APPLICATION_NAME}/stream-list
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"success",
   "data":{
      "streamCount":2,
      "streamList":[
         {
            "streamName":"test",
            "viewerCount":100,
            "state":"PUBLISHED",
            "sourceState":"PUBLISHED",
            "startTime":1685526733,
            "incomingBandwidth":3650,
            "outgoingBandwidth":292000
         },
         {
            "streamName":"example",
            "viewerCount":1,
            "state":"AWAITING",
            "sourceState":"CONNECTING",
            "startTime":1685526733,
            "incomingBandwidth":0,
            "outgoingBandwidth":0
         }
      ]
   }
}
                                        
Table 5. Get application stream list table.

Field explanation:

streamCountTotal number of active streams.
streamNameStream name.
viewerCountNumber of viewer connections.
sourceStateCurrent source state (PUBLISHED, UNPUBLISHED, NOT_PUBLISHED, ENDED, AWAITING, INITIALIZED, CONNECTED, HIBERNATED, CLOSING, CLOSED).
stateCurrent stream state (PUBLISHED, UNPUBLISHED, NOT_PUBLISHED, ENDED, AWAITING, INITIALIZED, CONNECTED, HIBERNATED, CLOSING, CLOSED).
startTimeStream start time in UNIX time format.
outgoingBandwidthDownload speed for this stream (generated by a source).
incomingBandwidthUpload speed for this stream (all viewer connections).
Table 6. Get application stream list fields table.

Get Application Configuration

Request typeGET
URL/rest-api/applications/${APPLICATION_NAME}/config
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"success",
   "data":{
      "RTMPController":{
         "allowStreamPublish":true,
         "allowStreamOverwrite":true,
         "allowClientPlayback":true,
         "keepClientStreamsAlive":true,
         "playbackAuthRequired":true
      },
      "secureStream":{
         "enabled":true,
         "password":"qwerty",
         "checkViewerIP":false,
         "tokenLifespan":10
      },
      "MP4MuxerSettings":{
         "variableFPS":true,
         "keyFrameCompensation":true
      },
      "DVRSettings":{
         "enabled":false,
         "cacheSize":100
      },
      "recordingSettings":{
         "enabled":false,
         "cacheSize":100,
         "savePath":"/srv/storm/recordings"
      }
   }
}
                                        
Table 7. Get application configuration table.

Field explanation:

RTMPControllerRTMP settings block. For specific field reference please check Live Application Configuration guide.
SecureStreamSecure Stream settings block. For specific field reference please Live Application Configuration guide.
MP4MuxerSettingsMP4 Muxer settings block. For specific field reference please check Live Application Configuration guide.
DVRSettingsDVR settings block. For specific field reference please check Live Application Configuration guide.
RecordingSettingsRecording settings block. For specific field reference please check Live Application Configuration guide.
Table 8. Get application configuration fields table.

Please keep in mind that application configuration will differ for each type of application.

Delete Application

Request typeDELETE
URL/rest-api/applications/${APPLICATION_NAME}
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"success",
   "data":{
      "command":"delete"
   }
}
                                        
Table 9. Delete application table.

Field explanation:

commandRepeats command from Request Data.
Table 10. Delete application fields table.

Create Application

Request typePUT
Request Data

{
   "data":{
      "applicationName":"live",
      "applicationType":"live",
      "RTMPController":{
         "allowStreamPublish":true,
         "allowStreamOverwrite":true,
         "allowClientPlayback":true,
         "keepClientStreamsAlive":true,
         "playbackAuthRequired":true
      },
      "secureStream":{
         "enabled":true,
         "password":"qwerty",
         "checkViewerIP":false,
         "tokenLifespan":10
      },
      "MP4MuxerSettings":{
         "variableFPS":true,
         "keyFrameCompensation":true
      },
      "DVRSettings":{
         "enabled":false,
         "cacheSize":100
      },
      "recordingSettings":{
         "enabled":false,
         "cacheSize":100,
         "SavePath":"/srv/storm/recordings"
      }
   }
}
                                        
URL/rest-api/applications
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"success",
   "data":{
      "command":"create"
   }
}
                                        
Table 11. Create application table.

Field explanation:

commandRepeats command from Request Data.
applicationNameName for new application.
applicationTypeType of new application. Possible values: live, origin, edge.
RTMPControllerRTMP settings block. For specific field reference please check Live Application Configuration guide.
SecureStreamSecure Stream settings block. For specific field reference please check Live Application Configuration guide.
MP4MuxerSettingsMP4 Muxer settings block. For specific field reference please check Live Application Configuration guide.
DVRSettingsDVR settings block. For specific field reference please check Live Application Configuration guide.
RecordingSettingsRecording settings block. For specific field reference please check Live Application Configuration guide.
Table 12. Create application fields table.

Get Authorization Data

Request typeGET
URL/rest-api/applications/${APPLICATION_NAME}/authorization
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"success",
   "data":{
      "enabled":true,
      "authorizationList":[
         {
            "type":"credentials",
            "username":"admin",
            "password":"qwerty"
         },
         {
            "type":"token",
            "token":"62cjdj",
            "expireTime":1685560070
         }
      ]
   }
}
                                        
Table 13. Get authorization data table.

Field explanation:

enabledInforms whenever publishing authorization is enabled for this application.
authorizationListList of all authorization items. Items can be of “credentials” and “token” type.
typeType of authorization item. it can be of “credentials” and “token” type.
usernameUsername for credentials authorization item.
passwordPassword for credentials authorization item.
tokenToken string for token authorization item.
expireTimeTime after which token expires expressed (unix timestamp).
Table 14. Get authorization data fields table.

Add Authorization Data

Request typePUT
Request Data

{
   "type":"credentials",
   "username":"admin",
   "password":"qwerty"
}

// or

{
   "type":"token",
   "token":"62cjdj",
   "expireTime":1685560070
}
                                        
URL/rest-api/applications/${APPLICATION_NAME}/authorization
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"success",
   "data":{
      "command":"create"
   }
}
                                        
Table 15. Add authorization data table.

Field explanation:

typeType of authorization item. it can be of “credentials” and “token” type.
usernameUsername for credentials authorization item.
passwordPassword for credentials authorization item.
tokenToken string for token authorization item.
expireTimeTime after which token expires expressed (unix timestamp).
Table 16. Add authorization data fields table.

Delete Authorization Data

Request typeDELETE
Request Data

{
   "type":"credentials",
   "username":"admin",
   "password":"qwerty"
}

// or

{
   "type":"token",
   "token":"62cjdj"
}
                                        
URL/rest-api/applications/${APPLICATION_NAME}/authorization
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"success",
   "data":{
      "command":"delete"
   }
}
                                        
Table 17. Delete authorization data table.

Field explanation:

typeType of authorization item. it can be of “credentials” and “token” type.
usernameUsername for credentials authorization item.
passwordPassword for credentials authorization item.
tokenToken string for token authorization item.
Table 18. Delete authorization data fields table.
Support Needed?

Create a free ticket and our support team will provide you necessary assistance.