Description:

  • Send a stream-pulling command and return the stream-pulling address.

API Version:

Version Author Date Revision
2.0.0 lenny 2023-04-07

Request URL:

Request Method:

  • POST

Request Header:

Parameter Required Type Description
Content-Type Yes string Request type: application/json

Request Parameters:

Parameter Required Type Description
FTokenID Yes string Token ID
FAction Yes string Method name (RealTimeVideoPlay)
FAssetGUID Yes string Unique Device Identifier
FChannel No Int Playback channel; defaults to channel 1 if not specified.
FInterval No Int Stream pulling duration (in seconds; default is 1 minute; supports a range of 0–10 minutes)

Response Example:

Success:

{
    "Result": 200,
    "Message": "ins send ok",
    "FObject": {
        "flv": "http://media.assetscontrols.com:8111/rtp/804250900031/1.live.flv",
        "https_flv": "https://media.assetscontrols.com:7443/rtp/804250900031/1.live.flv",
        "ws_flv": "ws://media.assetscontrols.com:8111/rtp/804250900031/1.live.flv",
        "wss_flv": "wss://media.assetscontrols.com:7443/rtp/804250900031/1.live.flv",
        "rtmp": "rtmp://media.assetscontrols.com:8935/rtp/804250900031/1",
        "rtsp": "rtsp://media.assetscontrols.com:8554/rtp/804250900031/1"
    }
}

Error:

{
    "Result": 102,
    "Message": "Action is error",
    "FObject": []
}

Response Parameter:

Parameter Type Description
flv string FLV-format HTTP stream URL
https_flv string FLV-format Https stream URL
ws_flv string FLV-format WebSocket stream URL
wss_flv string FLV-format WSS stream URL
rtmp string rtmp stream URL
rtsp string rtsp stream URL

Remarks:

  • Additional error codes are as follows:
  • 102: Parameter error
  • 105: System exception
  • 108: Exception in sending command
  • 122: Monitoring server not configured for the device
  • 123: Not supported by the device
  • 111: Device is offline or in sleep mode

Request Example::

Java:

String result = "";
//Request path
String url = "https://cloud.assetscontrols.com:3443/OpenApi/Monitor";  
//Request parameters, json format parameters, it is recommended to use objects to pass in
String body = "{FAction:\"RealTimeVideoPlay\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FAssetGUID:\"7f6b94c8-abda-48aa-9eec-9e2d8c5f6a3c\",FChannel:1,FInterval:60}";  
URL realUrl = new URL(url);
// Set the properties of the common request
URLConnection conn = realUrl.openConnection(); 
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "keep-Alive");
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
conn.setRequestProperty("method", "post");
// Must set the following two lines when sending a POST request
conn.setDoOutput(true);
conn.setDoInput(true);
PrintWriter pw = new PrintWriter(conn.getOutputStream());
// Send request parameters
pw.print(body);
// flush output stream buffer  
pw.flush();   
// Define BufferedReader input stream to read URL response
BufferedReader bufReader = new BufferedReader(new InputStreamReader(conn.getInputStream()));  
// Define BufferedReader input stream to read URL response
String line;
while ((line = bufReader.readLine()) != null) {
     result += line;        
 }
// The returned value is a JSON string
return result;

C#:

// Request URL
string url = "https://cloud.assetscontrols.com:3443/OpenApi/Monitor";  
// Request parameters, use json format and recommend using an object to pass it in
string body = "{FAction:\"RealTimeVideoPlay\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FAssetGUID:\"7f6b94c8-abda-48aa-9eec-9e2d8c5f6a3c\",FChannel:1,FInterval:60}"; 
Encoding encoding = Encoding.UTF8;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
 // Request method post / get
request.Method = "post"; 
request.Accept = "*/*";    
request.ContentType = "application/json";
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";
byte[] buffer = encoding.GetBytes(body);
request.ContentLength = buffer.Length;
request.GetRequestStream().Write(buffer, 0, buffer.Length);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
using (StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8))
{
    // The return value is a json string
    return reader.ReadToEnd();
}

Python:

url = 'https://cloud.assetscontrols.com:3443/OpenApi/Monitor'
      data = {
      'FAction': 'RealTimeVideoPlay',
      'FTokenID': '3acef045-d302-4032-b40a-d9ee6c1519cd',
      'FAssetGUID':'7f6b94c8-abda-48aa-9eec-9e2d8c5f6a3c',
      'FChannel':1,
      'FInterval':60
       }
      data = parse.urlencode(data).encode('utf-8')
      headers = {
       'User-Agent': r'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) '
                     r'Chrome/45.0.2454.85 Safari/537.36 115Browser/6.0.3',
       'Connection': 'keep-alive'
       }
      req = request.Request(url, headers=headers, data=data)  
      page = request.urlopen(req).read()
      page = page.decode('utf-8')
      # json_array = json.loads(page)
      return page;
文档更新时间: 2026-11-02 10:07   作者:Jeson