Red5 Pro Server API

The Red5 Pro Server API can be used to gather statistics for server, application, clients and streams over simple HTTP based REST api calls. The calls can be executed using any standard REST client (for example the Google Chrome Add-On: Postman REST client)

Security and Configuration

To use the Red5 Pro Server API, you must set a security access Token in the file {red5pro_home}\webapps\api\WEB-INF\red5-web.properties. The security.accessToken= is blank by default, which disables API access.

With the CORE SECURITY PROVIDER SETTINGS set to true, a token is required for use with any of the API REST calls.

Additional security is set in {red5pro_home}\webapps\api\WEB-INF\security\hosts.txt. This is set to localhost with the Red5 Pro Server distribution. You can add specific IP addresses, one per line, to allow access.

For example:

localhost
98.76.54.32
~

Alternatively, you can allow access from all IPs with a * entry:

localhost
*
~

Note: You will need to restart Red5 Pro if you modify either or both of the above files.


Server API

getServerInfo

Description

Returns basic Red5 Pro server information.

REQUEST

  • URI : http://{host}:5080/api/v1/server?accessToken={security-token}
  • Method: GET
  • Parameters:
Property Type Description Required Default
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: NA
  • Data: NA
  • Success: HTTP CODE 200 - OK
  • Data: Returns a ServerInfo json object. See Response objects for attribute definitions.

Example

REQUEST

  • URI http://localhost:5080/api/v1/server?accessToken=xyz123
  • Method: GET

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": {
    "red5_pro_version": "1.2.1.b109-release",
    "fms_version": "RED5/1,0,7,0",
    "capabilities": 33,
    "uptime": 473884
  },
  "timestamp": 1467224198453
}

ping

Description

Pings the server to see if it’s alive, and returns its latest timestamp.

REQUEST

  • URI : http://{host}:5080/api/v1/server/ping?accessToken={security-token}
  • Method: GET
  • Parameters:
Property Type Description Required Default
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: NA
  • Data: NA

  • Success: HTTP CODE 200 - OK

  • Data:

Example

REQUEST

  • URI http://localhost:5080/api/v1/server/ping?accessToken=xyz123
  • Method: GET

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": 1467060909455,
  "timestamp": 1467060909455
}

getServerStatistics

Description

Returns detailed server statistics report. Total_connections are the total since server was started, active_connections are the current live connections, and max_connections are the maximum number of concurrent connections since server startup.

REQUEST

  • URI : http://{host}:5080/api/v1/server/statistics?accessToken={security-token}
  • Method: GET
  • Parameters:
Property Type Description Required Default
app Query Param Application name Required
unit Query Param Unit of data transfer Optional b (bytes)
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: HTTP CODE 400 or 404 or 500 or 401 See failure status code table for more information on error cause.
  • Data:
{
  "status": "error",
  "code": <http-status-code>,
  "message": <error-message>",
  "timestamp": <server-timestamp>
}

Example

REQUEST

  • URI: http://localhost:5080/api/v1/server/statistics?accessToken=xyz123
  • Method: GET

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": {
    "version": "1.2.1.b109-release",
    "fms_version": "RED5/1,0,7,0",
    "up_time": 2436402,
    "os_name": "Mac OS X",
    "os_version": "10.11.5",
    "processors": 4,
    "architecture": "x86_64",
    "total_memory": 222298112,
    "max_memory": 1908932608,
    "free_memory": 22372784,
    "num_apps": 5,
    "active_sub_scopes": 1,
    "total_sub_scopes": 4,
    "max_sub_scopes": 1,
    "total_connections": 9,
    "active_connections": 1,
    "max_connections": 2,
    "bytes_in": 12,
    "bytes_out": 0,
    "messages_in": 0,
    "messages_out": 0,
    "data_unit": "b"
  },
  "timestamp": 1467060941836
}

Applications API

getApplications

Description

Returns a list of all the Red5 Pro web applications on the server.

REQUEST

  • URI:http://{host}:5080/api/v1/applications?accessToken={security-token}
  • Method: GET
  • Parameters:
Property Type Description Required Default
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: NA
  • Data: NA

  • Success: HTTP CODE 200 - OK

  • Data:

Example

REQUEST

  • URI:http://localhost:5080/api/v1/applications?accessToken=xyz123
  • Method: GET

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": [
    "api",
    "live"
  ],
  "timestamp": 1467060546158
}

getApplicationStatistics

Description

Returns statistics for all applications or a selection of applications. Optionally you can provide the relative path to the scope (subdirectory of an application) if you wish to get statistics for that scope. A list of applications can be specified by providing multiple entries for query parameter 'app' in the query string.

REQUEST

  • URI:http://{host}:5080/api/v1/applications/statistics?accessToken={security-token}
  • Method: GET
  • Parameters:
Property Type Description Required Default
app Query Param Application name Required
scope Query Param Application sub scope path Optional (For use with single app request)
unit Query Param Unit of data transfer Optional b (bytes)
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: HTTP CODE 400 or 404 or 500 or 401 See failure status code table for more information on error cause.
  • Data:
{
  "status": "error",
  "code": <http-status-code>,
  "message": <error-message>",
  "timestamp": <server-timestamp>
}

Example

REQUEST

  • URI: http://localhost:5080/api/v1/applications/statistics?accessToken=xyz123
  • Method: GET

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": [
       {
      "name": "live",
      "path": "/default",
      "creation_time": 1467058529097,
      "depth": 1,
      "active_connections": 0,
      "total_connections": 9,
      "max_connections": 2,
      "active_subscopes": 1,
      "total_subscopes": 4,
      "max_subscopes": 1,
      "bytes_in": 10,
      "bytes_out": 0,
      "messages_out": 0,
      "messages_in": 0,
      "type": "application",
      "data_unit": "b"
    }
  ],
  "timestamp": 1467060616203
}

getApplicationStatistics (single)

Description

Returns statistics for a single application. Optionally you can provide the relative path to the scope (subdirectory of an application) if you wish to get statistics for that scope.

REQUEST

  • URI :http://{host}:5080/api/v1/applications/{appname}?accessToken={security-token}
  • Method: GET
  • Parameters:
Property Type Description Required Default
appname Query Param Application name Required
scope Query Param Application sub scope path Optional (For use with single app request)
unit Query Param Unit of data transfer Optional b (bytes)
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: HTTP CODE 400 or 404 or 500 or 401 See failure status code table for more information on error cause.
  • Data:
{
  "status": "error",
  "code": <http-status-code>,
  "message": <error-message>",
  "timestamp": <server-timestamp>
}

Example

REQUEST

  • URI: http://localhost:5080/api/v1/applications/live?accessToken=xyz123
  • Method: GET

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": {
      "name": "live",
      "path": "/default",
      "creation_time": 1467058529097,
      "depth": 1,
      "active_connections": 0,
      "total_connections": 9,
      "max_connections": 2,
      "active_subscopes": 1,
      "total_subscopes": 4,
      "max_subscopes": 1,
      "bytes_in": 10,
      "bytes_out": 0,
      "messages_out": 0,
      "messages_in": 0,
      "type": "application",
      "data_unit": "b"
    },
  "timestamp": 1467060616203
}

invoke

Description

Invokes a custom method on the application's ApplicationAdapter class. Note: HTTP to java RMI has limitations. Use String, Double (for numerics).

The invoke api is applicable only to custom developed Red5Pro applications and is used for invoking custom methods on the ApplicationAdapter. These custom methods may carry a business logic which is specific to the given application.

REQUEST

  • URI: http://{host}:5080/api/v1/applications/{appname}/invoke?accessToken={security-token}
  • Method: POST
  • Parameters:
Property Type Description Required Default
appname Path Param Application name Required
Custom Method Invoke Object Post Param Json Complex Object Required
accessToken Query Param Security token Required if token security is enabled

Custom Method Invoke Object

{
  "method": "",
  "parameters": [ ]
}

RESPONSE

  • Failure: HTTP CODE 400 or 404 or 500 or 401 See failure status code table for more information on error cause.
  • Data:
{
  "status": "error",
  "code": <http-status-code>,
  "message": <error-message>",
  "timestamp": <server-timestamp>
}
  • Success: HTTP CODE 200 - OK
  • Data: Custom Json serialized object as per developer's return type in the invoked method.
{
  "status": "success",
  "code": 200,
  "data": {CustomResponseObject},
  "timestamp": 1467060941836
}

Example 1

Below is a sample of the ApplicationAdapter of a custom Red5 Pro application with a custom method called sayHello. The objective of the method is to recieve a clientname parameter and return a welcome message.

public class Application extends MultiThreadedApplicationAdapter
{
    private static Logger log = Red5LoggerFactory.getLogger(Application.class, "Application");
    public String sayHello(String name)
    {
        return "Welcome " + name;
    }
}

REQUEST

  • URI: http://localhost:5080/api/v1/applications/api/invoke?accessToken=xyz123
  • Method: POST
  • Data: JSON
{
  "method": "sayHello",
  "parameters": [
    "Tony"
  ]
}

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": "Welcome Tony",
  "timestamp": 1467193076102
}

Example 2

In this example we have a custom made application with a method to accept two integers and print the sum. Below is a sample of the ApplicationAdapter of a custom Red5 Pro application with a custom method called getSum. The objective of the method is to receive two parameters and return the sum.

public class Application extends MultiThreadedApplicationAdapter
{
    private static Logger log = Red5LoggerFactory.getLogger(Application.class, "Application");

    public Integer add(Double  a, Double  b)
    {
        return a.intValue() + b.intValue();
    }
}

Note that the parameters type is declared as Double. This is because any number in json is a float (contains decimal place). So if you pass 1 it is treated as 1.0. However when returning a result, you may return any data type which can be serialized into json.

REQUEST

  • URI: http://localhost:5080/api/v1/applications/api/invoke?accessToken=xyz123
  • Method: POST
  • Data: JSON
{
  "method": "getSum",
  "parameters": [
    1,
    2
  ]
}

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": 3,
  "timestamp": 1467193610836
}

Recorded Content (VOD) API

getVodFiles

Description

Returns the list of available media files in a specified application's streams storage directory.

REQUEST

  • URI : http://{host}:5080/api/v1/applications/{appname}/media?accessToken={security-token}
  • Method: GET
  • Parameters:
Property Type Description Required Default
appname Path Param Application name Required
scope Query Param Application sub scope path Optional
extension Query Param Extension for filtering lookup Optional
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: HTTP CODE 400 or 404 or 500 or 401 See failure status code table for more information on error cause.
  • Data:
{
  "status": "error",
  "code": <http-status-code>,
  "message": <error-message>",
  "timestamp": <server-timestamp>
}

Example

REQUEST

  • URI: http://localhost:5080/api/v1/applications/live/media?accessToken=xyz123
  • Method: GET
  • Data:

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": [
    {
      "name": "stream1.flv",
      "last_modified": 1466098500000,
      "file_size": 785
    },
    {
      "name": "stream2.flv",
      "last_modified": 1466102050000,
      "file_size": 1747
    },
    {
      "name": "stream3.flv",
      "last_modified": 1467059658000,
      "file_size": 5795
    }
  ],
  "timestamp": 1467060770935
}

deleteVodFile

Description

Deletes a media file from stream storage location by its name and extension.

REQUEST

  • URI: http://{host}:5080/api/v1/applications/{appname}/media?filename={filename}&extension={extension}&accessToken={security-token}
  • Method: DELETE
  • Parameters:
Property Type Description Required Default
appname Path Param Application name Required
scope Query Param Application sub scope path Optional
filename Query Param filename to delete Optional
extension Query Param Extension for file lookup Required
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: HTTP CODE 400 or 404 or 500 or 401 See failure status code table for more information on error cause.
  • Data:
{
  "status": "error",
  "code": <http-status-code>,
  "message": <error-message>",
  "timestamp": <server-timestamp>
}

Example

REQUEST

  • URI: http://localhost:5080/api/v1/applications/live/media?filename=stream1&extension=flv&accessToken=xyz123
  • Method: DELETE
  • Data:

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": {
    "name": "stream1.flv",
    "last_modified": 1466102050000,
    "file_size": 1747
  },
  "timestamp": 1467060841959
}

SharedObjects API

Shared objects are collaboration points for Red5 Pro applications. These are mostly used for chats, games, etc. used to update real-time data to all connected clients. Shared objects are also known as server-side cookies.

getSharedObjects

Description

Returns list of shared object names in the specified application.

REQUEST

  • URI: http://{host}:5080/api/v1/applications/{appname}/sharedobjects?accessToken={security-token}
  • Method: GET
  • Parameters:
Property Type Description Required Default
appname Path Param Application name Required
scope Query Param Application sub scope path Optional
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: HTTP CODE 404 or 500 or 401 See failure status code table for more information on error cause.
  • Data:
{
  "status": "error",
  "code": <http-status-code>,
  "message": <error-message>",
  "timestamp": <server-timestamp>
}
  • Success: HTTP CODE 200 - OK
  • Data:

Example

REQUEST

  • URI: http://localhost:5080/api/v1/applications/live/sharedobjects?accessToken=xyz123
  • Method: GET
  • Data:

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": [
    "BallControl"
  ],
  "timestamp": 1467211887976
}

getSharedObjectStatistics

Description

Returns statistics for a requested SharedObject.

REQUEST

  • URI: http://{host}:5080/api/v1/applications/{appname}/sharedobjects/{soname}?accessToken={security-token}
  • Method: GET
  • Parameters:
Property Type Description Required Default
appname Path Param Application name Required
soname Path Param Shared object name Required
scope Query Param Application sub scope path Optional
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: HTTP CODE 404 or 500 or 401 See failure status code table for more information on error cause.
  • Data:
{
  "status": "error",
  "code": <http-status-code>,
  "message": <error-message>",
  "timestamp": <server-timestamp>
}

Example

REQUEST

  • URI: http://localhost:5080/api/v1/applications/live/sharedobjects/BallControl?accessToken=xyz123
  • Method: GET
  • Data:

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": {
    "name": "BallControl",
    "persistent": false,
    "version": 1,
    "active_listeners": 1,
    "total_listeners": 1,
    "max_listeners": 1,
    "total_changes": 0,
    "total_deletes": 0,
    "totalSends": 0
  },
  "timestamp": 1467211947486
}

Streams API

getLiveStreams

Description

Returns all live streams in the specified application.

REQUEST

  • URI: http://{host}:5080/api/v1/applications/{appname}/streams?accessToken={security-token}
  • Method: GET
  • Parameters:
Property Type Description Required Default
appname Path Param Application name Required
scope Query Param Application sub scope path Optional
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: HTTP CODE 404 or 500 or 401 See failure status code table for more information on error cause.
  • Data:
{
  "status": "error",
  "code": <http-status-code>,
  "message": <error-message>",
  "timestamp": <server-timestamp>
}
  • Success: HTTP CODE 200 - OK
  • Data:

Example

REQUEST

  • URI: http://localhost:5080/api/v1/applications/live/streams?accessToken=xyz123
  • Method: GET
  • Data:

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": [
    "stream1",
    "stream2"
  ],
  "timestamp": 1467061170310
}

getLiveStreamStatistics

Description

Returns statistics for the specified live stream.

REQUEST

  • URI: http://{host}:5080/api/v1/applications/{appname}/streams/{streamname}?accessToken={security-token}
  • Method: GET
  • Parameters:
Property Type Description Required Default
appname Path Param Application name Required
streamname Path Param Stream name Required
scope Query Param Application sub scope path Optional
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: HTTP CODE 404 or 500 or 401 See failure status code table for more information on error cause.
  • Data:
{
  "status": "error",
  "code": <http-status-code>,
  "message": <error-message>",
  "timestamp": <server-timestamp>
}

Example

REQUEST

  • URI: http://localhost:5080/api/v1/applications/live/streams/stream1?accessToken=xyz123
  • Method: GET
  • Data :

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": {
    "bytes_received": 1017748288,
    "active_subscribers": 1,
    "total_subscribers": 2,
    "max_subscribers": 2,
    "id": 1,
    "name": "6a4857ac-c7c6-4637-a583-b414f94ef875",
    "publish_name": "stream1",
    "creation_time": 1467059370440,
    "scope_path": "/default",
    "is_recording": false,
    "state": "uninit"
  },
  "timestamp": 1467061226826
}

recordLiveStream

Description

Starts the recording of an active live stream (if you are publishing a stream you can choose to record it via this command even if you haven't started it with the R5RecordTypeRecord setting in the mobile client).

REQUEST

  • URI: http://{host}:5080/api/v1/applications/{appname}/streams/{streamname}/action/startrecord?accessToken={security-token}
  • Method: GET
  • Parameters:
Property Type Description Required Default
appname Path Param Application name Required
streamname Path Param Stream name Required
saveas Query Param filename to save as Optional {streamname}
append Query Param Append flag Optional false
scope Query Param Application sub scope path Optional
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: HTTP CODE 404 or 400 or 409 or 500 or 401 See failure status code table for more information on error cause.
  • Data:
{
  "status": "error",
  "code": <http-status-code>,
  "message": <error-message>",
  "timestamp": <server-timestamp>
}

Example

REQUEST

  • URI: http://localhost:5080/api/v1/applications/live/streams/stream1/action/startrecord?accessToken=xyz123
  • Method: GET
  • Data:

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": {
    "record_name": "stream1.flv",
    "append": false,
    "id": 1,
    "name": "6a4857ac-c7c6-4637-a583-b414f94ef875",
    "publish_name": "streams",
    "creation_time": 1467059370440,
    "scope_path": "/default",
    "is_recording": true,
    "state": "UNINIT"
  },
  "timestamp": 1467061453937
}

stopStreamRecord

Description

Stops the ongoing recording of a live stream. Note: this can only be run against a recording that has been started via the API.

REQUEST

  • URI: http://{host}:5080/api/v1/applications/{appname}/streams/{streamname}/action/stoprecord?accessToken={security-token}
  • Method: GET
  • Parameters:
Property Type Description Required Default
appname Path Param Application name Required
streamname Path Param Stream name Required
scope Query Param Application sub scope path Optional
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: HTTP CODE 404 or 400 or 409 or 500 or 401 See failure status code table for more information on error cause.
  • Data:
{
  "status": "error",
  "code": <http-status-code>,
  "message": <error-message>",
  "timestamp": <server-timestamp>
}

Example

REQUEST

  • URI: http://localhost:5080/api/v1/applications/live/streams/stream1/action/stoprecord?accessToken=xyz123
  • Method: GET
  • Data:

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": {
    "id": 1,
    "name": "6a4857ac-c7c6-4637-a583-b414f94ef875",
    "publish_name": "streams",
    "creation_time": 1467059370440,
    "scope_path": "/default",
    "is_recording": false,
    "state": "UNINIT"
  },
  "timestamp": 1467061492531
}

Client Control API

getClients

Description

Returns list of clients (connections) on this application.

REQUEST

  • URI: http://{host}:5080/api/v1/applications/{appname}/clients?accessToken={security-token}
  • Method: GET
  • Parameters:
Property Type Description Required Default
appname Path Param Application name Required
scope Query Param Application sub scope path Optional
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: HTTP CODE 404 or 500 or 401 See failure status code table for more information on error cause.
  • Data:
{
  "status": "error",
  "code": <http-status-code>,
  "message": <error-message>",
  "timestamp": <server-timestamp>
}
  • Success: HTTP CODE 200 - OK
  • Data: Returns a list of Client json object. See Response objects for attribute definition.

Example

REQUEST

  • URI: http://localhost:5080/api/v1/applications/live/clients?accessToken=xyz123
  • Method: GET
  • Data:

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": [
    {
      "id": "S9YD7FMFXK9WG",
      "creation_time": 1467122341429,
      "last_ping": -1,
      "remote_address": "192.168.0.102"
    }
  ],
  "timestamp": 1467122362235
}

getClientStatistics

Description

Returns connections details for a single client (connection).

REQUEST

  • URI: http://{host}:5080/api/v1/applications/{appname}/clients/{clientId}?accessToken={security-token}
  • Method: GET
  • Parameters:
Property Type Description Required Default
appname Path Param Application name Required
clientId Path Param Client id Required
scope Query Param Application sub scope path Optional
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: HTTP CODE 404 or 500 or 401 See failure status code table for more information on error cause.
  • Data:
{
  "status": "error",
  "code": <http-status-code>,
  "message": <error-message>",
  "timestamp": <server-timestamp>
}

Example

REQUEST

  • URI: http://localhost:5080/api/v1/applications/live/clients/S9YD7FMFXK9WG?accessToken=xyz123
  • Method: GET
  • Data:

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": {
    "path": "live",
    "bytes_out": 4452098,
    "bytes_in": 3557,
    "messages_written": 10,
    "messages_read": 3484,
    "messages_dropped": 0,
    "messages_pending": -10,
    "remote_port": 50198,
    "connection_protocol": "rtmp",
    "host": "192.168.0.102",
    "id": "S9YD7FMFXK9WG",
    "creation_time": 1467122341429,
    "last_ping": -1,
    "remote_address": "192.168.0.102"
  },
  "timestamp": 1467122429965
}

terminateClient

Description

Terminates the specified client connection from an application.

REQUEST

  • URI: http://{host}:5080/api/v1/applications/{appname}/clients/{clientId}?accessToken={security-token}
  • Method: DELETE
  • Parameters:
Property Type Description Required Default
appname Path Param Application name Required
clientId Path Param Client id Required
scope Query Param Application sub scope path Optional
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: HTTP CODE 404 or 500 or 401 See failure status code table for more information on error cause.
  • Data:
{
  "status": "error",
  "code": <http-status-code>,
  "message": <error-message>",
  "timestamp": <server-timestamp>
}
  • Success: HTTP CODE 200 - OK
  • Data: Returns a Client json object. See Response objects for attribute definition.

Example

REQUEST

  • URI: http://localhost:5080/api/v1/applications/live/clients/S9YD7FMFXK9WG?accessToken=xyz123
  • Method: DELETE
  • Data:

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": {
    "id": "S9YD7FMFXK9WG",
    "creation_time": 1467122341429,
    "last_ping": -1,
    "remote_address": "192.168.0.102"
  },
  "timestamp": 1467122487591
}

terminateClients

Description

Terminates all client connections from an application.

REQUEST

  • URI: http://{host}:5080/api/v1/applications/{appname}/clients?accessToken={security-token}
  • Method: DELETE
  • Parameters:
Property Type Description Required Default
appname Path Param Application name Required
scope Query Param Application sub scope path Optional
accessToken Query Param Security token Required if token security is enabled

RESPONSE

  • Failure: HTTP CODE 404 or 500 or 401 See failure status code table for more information on error cause.
  • Data:
{
  "status": "error",
  "code": <http-status-code>,
  "message": <error-message>",
  "timestamp": <server-timestamp>
}
  • Success: HTTP CODE 200 - OK
  • Data: NA

Example

REQUEST

  • URI: http://localhost:5080/api/v1/applications/live/clients?accessToken=xyz123
  • Method: DELETE
  • Data:

RESPONSE

  • Success: HTTP CODE 200 - OK
  • Data:
{
  "status": "success",
  "code": 200,
  "data": {},
  "timestamp": 1467122593391
}

RESPONSE DATA OBJECTS

ServerInfo


PROPERTY TYPE DESCRIPTION
red5_pro_version String Red5 Pro version
fms_version String FMS version string (passed in rtmp handshakes)
capabilities Number RTMP server capabilities identifier
uptime Number Server uptime

ServerStatistics


PROPERTY TYPE DESCRIPTION
red5_pro_version String Red5 Pro version
fms_version String FMS version string (passed in rtmp handshakes)
capabilities Number RTMP server capabilities identifier
uptime Number Server uptime
os_name String Server operating system name
os_version String Server operating system version identifier
processors Number Total processor cores
architecture String CPU architecture
total_memory Number Total memory (in bytes) on server as reported by JVM
max_memory Number Maximum memory (in bytes) on server as reported by JVM
free_memory Number Free memory (in bytes) on server as reported by JVM
num_apps Number Number of applications on this instance
active_sub_scopes Number Total active sub scopes on this instance
total_sub_scopes Number Total sub scopes on this instance
max_sub_scopes Number Maximum sub scopes on this instance
total_connections Number Total Connections count on this instance
active_connections Number Active connection count on this instance
max_connections Number Maximum connection count on this instance
bytes_in Number Bytes received by server instance
bytes_out Number Bytes sent by server instance
messages_in Number Messages received by server instance
messages_out Number Messages sent by server instance
data_unit String Data unit used to evaluate and present data transfer information

Client


PROPERTY TYPE DESCRIPTION
id String Server assigned ID of the client
creation_time Number Client connection creation time
last_ping Number Round-trip time of last ping command for this connection
remote_address String Remote IP address the client is connected from

ClientStatistics


PROPERTY TYPE DESCRIPTION
id String Server assigned ID of the client
creation_time Number Client connection creation time
last_ping Number Round-trip time of last ping command for this connection
remote_address String Remote IP address the client is connected from
path String Connection path
bytes_out Number Total number of bytes read from the client
bytes_in Number Total number of bytes written to the client
messages_written Number Total number of messages written to the client.
messages_read Number Total number of messages read from the client
messages_dropped Number Total number of messages that have been dropped
messages_pending Number Total number of messages that are pending to be sent to the client
remote_port Number Remote port the client is connected from
connection_protocol String The protocol type for this connection. eg. rtmp, rtmpt, http
host String Host name / ip that the client used to connect to the application

StreamStatistics


PROPERTY TYPE DESCRIPTION
id String Server generated stream id
name String Server assigned stream name
publish_name String The actual published name for this stream
creation_time String Stream creation time
scope_path String The scope path for this stream
is_recording Boolean Whether this stream is currently recording or not
state String Server assigned state of the stream

BroadcastStreamStatistics


PROPERTY TYPE DESCRIPTION
id String Server generated stream id
name String Server assigned stream name
publish_name String The actual published name for this stream
creation_time String Stream creation time
scope_path String The scope path for this stream
is_recording Boolean Whether this stream is currently recording or not
state String Server assigned state of the stream
bytes_received Number Bytes received for the stream by server
active_subscribers Number Current active number of subscribers for the stream
total_subscribers Number Total number of subscribers for the stream since creation
max_subscribers Number Maximum number of subscribers for the stream

RecordStreamStatistics


PROPERTY TYPE DESCRIPTION
id String Server generated stream id
name String Server assigned stream name
publish_name String The actual published name for this stream
creation_time String Stream creation time
scope_path String The scope path for this stream
is_recording Boolean Whether this stream is currently recording or not
state String Server assigned state of the stream
record_name String File name by which the stream is recording
append Boolean Identifies whether recording is in append mode or overwrite mode

OnDemandMedia


PROPERTY TYPE DESCRIPTION
name String Media file name
last_modified Number Last modified date (timestamp) of the media file
file_size Number Media file size in bytes

SoStatistics


PROPERTY TYPE DESCRIPTION
name String Shared object name
persistent Boolean Shared object persistency
version Number Shared object version
active_listeners Number Active listeners subscribed to this shared object
total_listeners Number Total listeners subscribed to this shared object
max_listeners Number Maximum listeners subscribed to this shared object
total_changes Number Total number of attribute changes
total_deletes Number Total number of attribute deletes
total_sends Number Total number of times a message was sent over this shared object

ScopeStatistics


PROPERTY TYPE DESCRIPTION
name String Scope name
path String Scope path
creation_time String Scope creation time
depth Number Scope depth
active_connections Number Active connections on this scope
total_connections Number Active connections on this scope
active_connections Number Total connections on this scope
max_connections Number Maximum connections on this scope
active_subscopes Number Active sub scopes count for this scope
total_subscopes Number Total sub scopes for this scope
max_subscopes Number Maximum sub scopes for this scope
bytes_in Number Total bytes received by this scope
bytes_out Number Total bytes sent by this scope
messages_in Number Total messages sent by this scope
messages_out Number Total messages received by this scope
type String Scope type
data_unit String Data unit used to evaluate and present data transfer information

FAILURE STATUS CODES

HTTP CODE Error Details
404 Resource not found.
400 Bad Request because of incorrect number of arguments, or argument format or the order or arguments
409 Invalid operation requested. An operation is requested which cannot be performed given the current state of target resource.
500 Failure due to unknown internal server error
401 Unauthorized. The http client is denied access. Authentication information is missing or invalid.