简要描述:

  • 新的主动拍照,只支持CAMERA9_4指令,其它暂时用不上

接口版本:

版本号 制定人 制定日期 修订日期
2.0.0 lenny 2026-02-05

请求URL:

请求头:

参数名 是否必须 类型 说明
Content-Type string 请求类型: application/json

请求参数:

参数名 是否必须 类型 说明
FTokenID string 令牌ID
FAction string 方法名 (ActiveNewPhotograph)
FAssetGUID string 终端唯一标识
FT_GpActiveNewPhotograph Object

FT_GpActiveNewPhotograph

参数名 是否必须 类型 说明
FCameraID String 摄像头类型,0:主摄,1顶摄,目前只支持一个摄像头,默认0
FType int 操作类型,1:抓拍,2:录像,3:抓拍+录像
FCount int 抓拍张数,仅在操作类型1和3生效,其余填0即可
FDuration int 录像时长,单位:秒;仅在操作类型2和3生效,其余填0即可
FResolution int 分辨率,0:360p,1:480P,2:720P,3:1080P
FInterval int 抓拍间隔,单位秒.

返回示例:

正确时返回:

{
    "Result": 200,
    "Message": "ins send ok",
    "FObject": {
        "terminalStrId": "c5b53001-8755-4269-a9c8-b71ca04c6a0d",
        "terminalNum": "804250900200",
        "dateTime": "2025-12-20T06:58:41.04655Z",
        "dateTimestamp": 1766213921046,
        "response": "(804250900200,1,001,CAMERA,9,4,0,700160818000_1769373855)"
    }
}

指令应答说明:
(804250900200,1,001,CAMERA,9,4,0,700160818000_1769373855)
0:执行成功,1:摄像头处于忙
700160818000_1769373855:当前关联的文件名称序号

错误时返回:

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

返回参数说明:

参数名 类型 说明
terminalStrId String 设备唯一标识号
terminalNum String 设备号
dateTime String 指令时间
dateTimestamp String 指令时间戳
response String 指令回复内容

备注:

  • 更多返回错误代码如下:
  • 104:token错误或过期
  • 105:异常错误
  • 102:请求参数错误
  • 106: 无此设备
  • 111: 设备不在线
  • 131: 未集成此指令
  • 108: 指令发送失败
  • 138: 指令执行超时(指令发送成功,等待15秒,设备也未有结果返回)

请求示例:

Java:

String result = "";
//请求路径
String url = "https://cloud.assetscontrols.com:3443/OpenApi/Instruction";  
//请求参数 ,json格式参数,建议用对象传入
String body = "{\"FAction\":\"ActiveNewPhotograph\",\"FAssetGUID\":\"a64b2e58-9305-4a01-9c51-092205123945\",\"FT_GpActiveNewPhotograph\":{\"FCameraID\":0,\"FType\":1,\"FCount\":3,\"FDuration\":0,\"FResolution\":2,\"FInterval\":2},\"FTokenID\":\"3acef045-d302-4032-b40a-d9ee6c1519cd\",\"FTimeDifferent\":28800,\"FLanguage\":\"1\"}";  
URL realUrl = new URL(url);
// 设置通用请求的属性
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");
// 发送POST请求必须设置如下两行
conn.setDoOutput(true);
conn.setDoInput(true);
PrintWriter pw = new PrintWriter(conn.getOutputStream());
// 发送请求参数
pw.print(body);
// flush输出流的缓冲  
pw.flush();   
// 定义BufferedReader输入流来读取URL的响应
BufferedReader bufReader = new BufferedReader(new InputStreamReader(conn.getInputStream()));  
// 定义BufferedReader输入流来读取URL的响应
String line;
while ((line = bufReader.readLine()) != null) {
     result += line;        
 }
//返回的是json字符串
return result;

C#:

//请求路径
string url = "https://cloud.assetscontrols.com:3443/OpenApi/Instruction";  
//请求参数 ,json格式参数,建议用对象传入
string body = "{\"FAction\":\"ActiveNewPhotograph\",\"FAssetGUID\":\"a64b2e58-9305-4a01-9c51-092205123945\",\"FT_GpActiveNewPhotograph\":{\"FCameraID\":0,\"FType\":1,\"FCount\":3,\"FDuration\":0,\"FResolution\":2,\"FInterval\":2},\"FTokenID\":\"3acef045-d302-4032-b40a-d9ee6c1519cd\",\"FTimeDifferent\":28800,\"FLanguage\":\"1\"}"; 
Encoding encoding = Encoding.UTF8;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
 //请求方式 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))
{
    //返回的是json字符串
    return reader.ReadToEnd();
}

Python:

url = "https://cloud.assetscontrols.com:3443/OpenApi/Instruction"

payload = {
    "FAction": "ActiveNewPhotograph",
    "FAssetGUID": "a64b2e58-9305-4a01-9c51-092205123945",
    "FT_GpActiveNewPhotograph": {
        "FCameraID": 0,
        "FType": 1,
        "FCount": 1,
        "FDuration": 0,
        "FResolution": 2,
        "FInterval": 2,
    },
    "FTokenID": "3acef045-d302-4032-b40a-d9ee6c1519cd",
    "FTimeDifferent": 28800,
    "FLanguage": "1"
}
headers = {
    "Authorization": "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjZjNTg4Yjk2LTkyNTQtNDcyMC1iYzMwLWQ0ZTI0Mzc4YzMyMCJ9.oTjYmJFpmPDSqFX8oHkzdBMYhidGWxDaeygdKY3SphFrxq3yRzyPOq80kFUW1CH-gVW8M6tRlzTrPkvANMQxMg",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0",
    "Accept": "application/json, text/plain, */*",
    "Accept-Language": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2",
    "Accept-Encoding": "gzip, deflate",
    "Content-Type": "application/json",
    "Origin": "http://120.25.245.20:8081",
    "Connection": "keep-alive",
    "Referer": "http://120.25.245.20:8081/",
    "content-type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)

Node.js:


const request = require('request');

const options = {
  method: 'POST',
  url: 'https://cloud.assetscontrols.com:4443/OpenApi/Instruction',
  headers: {
    Authorization: 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjZjNTg4Yjk2LTkyNTQtNDcyMC1iYzMwLWQ0ZTI0Mzc4YzMyMCJ9.oTjYmJFpmPDSqFX8oHkzdBMYhidGWxDaeygdKY3SphFrxq3yRzyPOq80kFUW1CH-gVW8M6tRlzTrPkvANMQxMg',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0',
    Accept: 'application/json, text/plain, */*',
    'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
    'Accept-Encoding': 'gzip, deflate',
    'Content-Type': 'application/json',
    Origin: 'http://120.25.245.20:8081',
    Connection: 'keep-alive',
    Referer: 'http://120.25.245.20:8081/',
    'content-type': 'application/json'
  },
  body: {
    FAction: 'ActiveNewPhotograph',
    FAssetGUID: 'a64b2e58-9305-4a01-9c51-092205123945',
    FT_GpActiveNewPhotograph: {FAssetID: '876208000137', FCount: 1},
    FTokenID: '3acef045-d302-4032-b40a-d9ee6c1519cd',
    FTimeDifferent: 28800,
    FLanguage: '1'
  },
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
文档更新时间: 2026-02-05 16:06   作者:刘家帅