RESTful API - Application Management - Storm Streaming Server

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

Get Application List

Request type GET
URL /rest-api/applications
Answer HTTP/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:

applications List of all active applications.
applications:name Name of particular application.
applications:type Type of particular application (LIVE, EDGE, ORIGIN).
Table 2. Get application list fields table.

Get Application Info

Request type GET
URL /rest-api/applications/${APPLICATION_NAME}
Answer HTTP/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:

name Application name
type Application type, possible values: LIVE, EDGE, ORIGIN.
viewerCount Number of active video streams.
viewerCount Total number of viewers.
incomingBandwidth Download speed for this application (all incoming streams).
outgoingBandwidth Upload speed for this application (all viewer connections).
startDate Start date for this application in Unix time.
Table 4. Get application info fields table.

Get Application Stream List

Request type GET
URL /rest-api/applications/${APPLICATION_NAME}/stream-list
Answer HTTP/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:

streamCount Total number of active streams.
streamName Stream name.
viewerCount Number of viewer connections.
sourceState Current source state (PUBLISHED, UNPUBLISHED, NOT_PUBLISHED, ENDED, AWAITING, INITIALIZED, CONNECTED, HIBERNATED, CLOSING, CLOSED).
state Current stream state (PUBLISHED, UNPUBLISHED, NOT_PUBLISHED, ENDED, AWAITING, INITIALIZED, CONNECTED, HIBERNATED, CLOSING, CLOSED).
startTime Stream start time in UNIX time format.
outgoingBandwidth Download speed for this stream (generated by a source).
incomingBandwidth Upload speed for this stream (all viewer connections).
Table 6. Get application stream list fields table.

Get Application Configuration

Request type GET
URL /rest-api/applications/${APPLICATION_NAME}/config
Answer HTTP/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:

RTMPController RTMP settings block. For specific field reference please check Live Application Configuration guide.
SecureStream Secure Stream settings block. For specific field reference please Live Application Configuration guide.
MP4MuxerSettings MP4 Muxer settings block. For specific field reference please check Live Application Configuration guide.
DVRSettings DVR settings block. For specific field reference please check Live Application Configuration guide.
RecordingSettings Recording 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 type DELETE
URL /rest-api/applications/${APPLICATION_NAME}
Answer HTTP/1.1 200 OK
Content-Type: application/json

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

Field explanation:

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

Create Application

Request type PUT
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
Answer HTTP/1.1 200 OK
Content-Type: application/json

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

Field explanation:

command Repeats command from Request Data.
applicationName Name for new application.
applicationType Type of new application. Possible values: live, origin, edge.
RTMPController RTMP settings block. For specific field reference please check Live Application Configuration guide.
SecureStream Secure Stream settings block. For specific field reference please check Live Application Configuration guide.
MP4MuxerSettings MP4 Muxer settings block. For specific field reference please check Live Application Configuration guide.
DVRSettings DVR settings block. For specific field reference please check Live Application Configuration guide.
RecordingSettings Recording settings block. For specific field reference please check Live Application Configuration guide.
Table 12. Create application fields table.

Get Authorization Data

Request type GET
URL /rest-api/applications/${APPLICATION_NAME}/authorization
Answer HTTP/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:

enabled Informs whenever publishing authorization is enabled for this application.
authorizationList List of all authorization items. Items can be of “credentials” and “token” type.
type Type of authorization item. it can be of “credentials” and “token” type.
username Username for credentials authorization item.
password Password for credentials authorization item.
token Token string for token authorization item.
expireTime Time after which token expires expressed (unix timestamp).
Table 14. Get authorization data fields table.

Add Authorization Data

Request type PUT
Request Data

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

// or

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

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

Field explanation:

type Type of authorization item. it can be of “credentials” and “token” type.
username Username for credentials authorization item.
password Password for credentials authorization item.
token Token string for token authorization item.
expireTime Time after which token expires expressed (unix timestamp).
Table 16. Add authorization data fields table.

Delete Authorization Data

Request type DELETE
Request Data

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

// or

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

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

Field explanation:

type Type of authorization item. it can be of “credentials” and “token” type.
username Username for credentials authorization item.
password Password for credentials authorization item.
token Token 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.