OneNET IoT Platform Platform Introduction Introduction Manual Guidline for Device Development Guideline for Application Development
API
API Usage API List SDK MQTT LwM2M EDP Modbus TCP
HTTP Push MQ
Other Service Common Question

API Interface Document

API_ADDRESS address: v.api.cmcconenet.com/ipc/video/

1. Channel Management

1.1 Query Device Channel Information

HTTP method GET
URL http://API_ADDRESS/device/QryChannel
HTTP header api-key required
URL parameter device_id=//device ID required
HTTP content null
{
"errno":0,
"error":"succ",
"result":
[
{
"channel_id":20,
"title":"test_qwer",
"desc":"1qwqwq/"
},
{
"channel_id":100,
"title":"my_quto_test",
"desc":"123_test"
}
]
}

1.2 Delete Device Channel

HTTP method DELETE
URL http://API_ADDRESS/device/DelChannel
HTTP header api-key required
URL parameter device_id=//Device ID required
channel_id=//channel number, required
HTTP content null
Return success {
"errno":0,
"error":"succ"
}

1.3 Add Device Channel Information

HTTP method POST
URL http://API_ADDRESS/device/AddChannel
HTTP header api-key required
URL parameter device_id=//Device ID required
channel_id=//Channel ID, required
title=//title, required (length not exceeding 64 and can only be numbers, letters, or combination of numbers and letters)
desc=//Channel description
HTTP content null
Return success {
"errno": 0,
"error":"succ"
}
description If the channel already exists, then report error and return the following information:
{
"errno": 16,
"error": "The channel already exists,cannot add again!"
}

1.4 Modify Device Channel Information

HTTP method POST
URL http://API_ADDRESS/device/ModifyChannel
HTTP header api-key required
URL parameter device_id=//Device ID required
channel_id=//Channel ID, required
title=//title, required (length not exceeding 64 and can only be numbers, letters, or combination of numbers and letters)
desc=//Channel description
HTTP content null
Return success {
"errno": 0,
"error":"succ"
}
description If the channel doesn't exist, then report error and return the following information:
{
"errno": 17,
"error": "This channel is not available under this device!"
}

2. Query Device Online Status

HTTP method GET
URL http://API_ADDRESS/device/QryDevStatus
HTTP header api-key required
URL parameter devIds=123,456,789
//Device ID string, separated by commas, up to 30, length not exceeding 500, required field
HTTP content null
Return success {
"errno": 0,
"error": "succ",
"result": {
"total_count": 2,
"devices": [
{
"id": "2480461",
"online": false
},
{
"id": "2818370",
"online": false
}
]
}
}
description

3. Send Command

Devices accessed via ODVP (OneNET Video Device Access Protocol) complete command issue, obtain command status and command response via the following interfaces

3.1 Send Command

HTTP method POST
URL http://API_ADDRESS/cmds
HTTP header api-key required
URL parameter device_id =//Device ID
qos=//whether requires device response, 0 indicates not required, 1 indicates required the default value is 0
type=//command type, 0 indicates platform definition, 1 indicates user-defined; the default value is 0
HTTP content user-defined data: json, string, binary data (less than 64K)
Return success {
"errno": 0,
"error": "succ",
"data": {
"cmd_uuid": “2303-312-Fws”, //

instruction ID
"cmd_status": 4,//Status device send (Return of platform)
"dev_resp": {
"resp_code": 1,// error code device returned, 0 indicates success
"resp_data": "xxxxxxx" //base64 of data returned by the device
}
| |Description|resp_code the execution status of commands in the device
Cmd_status as follows:
0: Device offline
1: Command created sending
2: Command has been sent to device send ok
3: Command sent to device failed send error
4: Device responses normally ok
5: Command execution timeout time out
6: Device response data error resp data error.
When the command does not require device to reply, returning 2 indicates issue success.
When require device reply, the return >=4, indicates the device has returned during the process of http request. When equaling to 4, dev_resp is the return of device
Returning 1 and 2 need to call the command issue state interface to get the command issue status|

3.2 Command Status Query

HTTP method GET
URL http://API_ADDRESS/cmd_status
HTTP header api-key required
URL parameter device_id =//Device ID
cmd_uuid=//command ID returned by command issue interface
HTTP Content null
Return success {
"errno": 0,
"error":”succ”,
"data":{
"status": 1,//Status for the device send (return to the platform)
"desc": "sending"
}
Description Command status
0: Device offline
1: Command created sending
2: Command has been sent to device send ok
3: Command sent to device failed send error
4: Device responses normally ok
5: Command execution timeout time out
6: Device response data error resp data error

3.3 Command Response Query

HTTP method GET
URL http://API_ADDRESS/cmd_resp
HTTP header api-key required
URL parameter device_id =//Device ID
cmd_uuid=//command ID returned by command issue interface
HTTP Content null
Return success {
"errno": 0,
"error":”succ”,
"resp":”XXXXXXXXX” // Device response content, base64 encoding
}
Description Since the device response to platform, the effective time is 60 seconds, and the platform will delete the cached data of device response content after 60 seconds.

3.4 Command Specific Flowchart

For above three api, the flowchart when actually issuing a command is as follows:

qos==0, that is not require the command replied by device, such as: cloud platform operation, resolution adjustment, etc.

pic1

qos==1, that is require command replied by device, such as: Get video files list on device

pic2

3.5 General Command that Device Defined

a. Set the code stream level

{
    “type”: ”video”,
    ”cmdId”: 6,
    ”cmd”:{
           “channel_id”: 1, //channel ID, number
           “level”: 1 //number 1-4(1: Smooth 2: SD 3: HD 4: UD)
          }
}

b. Cloud platform control instructions

{
  ”type”: ”video”,
  ”cmdId”: 7,
”cmd”:{
”channel_id”: number, //Correspond to channel ID (mapping to the datastream name)
”stop”:number,  // 2  single-step control
"CmdV:number,  // 1: focal length largen (magnification largen) 2: focal length lessen (magnification lessen) 3: focus forward adjusting 4: focus backward adjusting 5: aperture expand 6: aperture narrowing 11: direction upward 12: direction downward 13: direction left turn, 14: direction right turn 22: automatic scan
”speed”: number //speed 1-7
    }
}

c.Local video list query

{
   ”type”: ”video”,             //instruction type (device SDK recognition)
   ”cmdId”: 10,                //query video list instruction (device SDK recognition)
   ”cmd”:{
         ”channel_id”:1,
         ”page”:1,
             ”start_time”: ”2017-09-29 12:00:31”, // optional
         ”end_time”: ”2017-09-29 13:00:30” //optional
         ”per_page”:20
}
}

Local video list response

”all_count”: 25,    //Total number of all videos queried
”cur_count”:20,   //Video number of current page video count
”rvods”:[
{
   ”channel_id”:1
   ”video_desc”: ”test123”,
   ”size”: 222,   // Bytes
   ”beginTime”: ”2017-09-29 12:00:31”,
   ”endTime”: ”2017-09-29 13:00:30”
  }
]
}

4. Query device transparent messages

HTTP method GET
URL http://API_ADDRESS/device/QryDevMsg
HTTP header api-key required
URL parameter device_id =//Device ID required
begin_time=//query start time required 2018-01-01 00:00:00
end_time=//query end time required 2018-01-02 00:00:00
HTTP content null
Return success {
"errno":0,
"error":"succ",
"page_info":
{
"total_num":7,
"page_total":1,
"page_size":50,
"current_page":1
},
"result":
[
{
"create_time":"2018-01-04 16:27:40",
"msg_id":14,
"msg":"bXlfdGVzdF8xMjM0NQ=="
},
{
"create_time":"2018-01-04 16:31:53",
"msg_id":14,
"msg":"bXlfdGVzdF8xMjM0NQ=="
},
{

"create_time":"2018-01-08 09:27:00",
"msg_id":4398046511104,
"msg":"bXlfdGVzdF8xMjM0NQ=="
},
{
"create_time":"2018-01-08 10:06:16",
"msg_id":4398046511104,
"msg":"bXlfdGVzdF8xMjM0NQ=="
},
{
"create_time":"2018-01-08 10:07:19",
"msg_id":4398046511104,
"msg":"bXlfdGVzdF8xMjM0NQ=="
},
{
"create_time":"2018-01-08 10:09:49",
"msg_id":4398046511104,
"msg":"bXlfdGVzdF8xMjM0NQ=="
},
{
"create_time":"2018-01-08 14:10:35",
"msg_id":4398046511104,
"msg":"bXlfdGVzdF8xMjM0NQ=="
}
]
}
Description Description: The message contents (msg field) the device transparent transmitted is base64 encoded, and require client decoding.

5. Pull-stream address acquisition

HTTP method GET
URL http://API_ADDRESS/play_address
HTTP header api-key required
URL parameter device_id =// Device ID to receive data, required
channel_id=//Correspond to the channelnum in datastream name
protocol_type=playback protocol type 0:rtmp 1:hls 2:https-hls
HTTP content null
Return success {
"errno": 0,
"error":”succ”,
“data”:{
"addr":"ip:port",
"accessToken":“string”,
"type":"rtmpe",
}
}
Description pull address needs to be stitched according to the return interface:
Rtmp real-time pull-stream address format: type://ip:port/live/${deviceid}-${channel_id}?accessToken
Rtmp Example of real-time pull-stream address: rtmp://183.230.40.39:1935/live/2162826-2?accessToken

Rtmp Historical pull address format:
rtmp://ip:port/rvod/${device_id}-${channel_id}-${begintime}-${endtime}?accessToken
Rtmp Example of historical pull address:
rtmp://183.230.40.39:1935/rvod/2162826-2-201711131530-201711131540?accessToken

Hls Real-time pull address format:
http://183.230.40.39:8080/live/live
${deviceid}${channel_id}/index.m3u8?accessToken
Hls Example of real-time pull address:
http://183.230.40.39:8080/live/live_2162826_2/index.m3u8?accessToken

6.HLS stream pre-load request

HTTP method Get
URL http://HLS_PLAY_ADDRESS/live/live_DEVICE_ID_CHANNEL_ID/preload
HTTP header api-key required
URL parameter token=xxxxx, // playback token
idle_time=120, //Idle cleanup time(s), Maximum value is 120
HTTP content
Return success {
"errno": 0,
"error": "succ"
}
Description HLS_PLAY_ADDRESS and token are returned by the HLS pull address interface. DEVICE_ID device ID, CHANNEL_ID channel ID
The interface can achieve HLS stream preloading purpose

7. Get Live Broadcast Thumbnail

HTTP method Get
URL http://coveraddr/live_preview/${device_id}-${channel_id}
HTTP header
URL parameter token = “”
HTTP content
Return success Picture binary content
Description Address and Token are the accesstoken and playback address returned when getting the pull address, and the url address can be assembled directly by playback address and token
http://coveraddr/live_preview/${device_id}_${channel_id}?token=accesstoken

8.1 Picture Upload

HTTP method GET
URL http://API_ADDRESS/picture/upload
HTTP header api-key required
URL parameter device_id =1
channel_id=1
format=”jpg”/”png”
name="111"
desc= “picture description”
HTTP content picture binary content
Return success {
"errno": 0,
"error": "succ"}
Description Can be used for the player screenshot upload, etc.
Return error if same with the picture name already uploaded

8.2 Get picture list information

HTTP method GET
URL http://API_ADDRESS/picture/get_list
HTTP header api-key required
URL parameter device_id ="1111"
channel_id=11
start_time=111, // UNIX timestamp, optional filter criteria
end_time=222, // UNIX timestamp, optional filter criteria
page_start= 1, //paging start
page_size=1 //paging size
HTTP content null
Return success {
"errno": 0,
"error":”succ”
data:[
{
"format":”jpg” // jpg or png
"size": 1234,//unit is byte
"date": 1234, // UNIX timestamp
"name":"111",// picture name (unique ID)
"desc" : "name", // picture description
"url" : "url" //picture get url
}
],
"page_info":{
"total_num":50
"page_total":25,
"page_size":2,
"current_page":1
}
}
Description

8.3 Get Picture Information

HTTP method GET
URL http://API_ADDRESS/picture/get_info
HTTP header api-key required
URL parameter device_id = "1111"
channel_id=11
name=1,//picture name
HTTP content null
Return success {
"errno": 0,
"error":”succ”
data:
{
"format":”jpg” // jpg or png
"size": 1234,//unit is byte
"date": 1234, // UNIX timestamp
"name":"111",// picture name (unique ID)
"desc" : "name", // picture description
"url" : "url" //picture get url
}
Description

8.4 Delete Picture

HTTP method DELETE
URL http://API_ADDRESS/picture/delete_info
HTTP header api-key required
URL parameter device_id = "1111"
channel_id=11
Name=1,//picture name
HTTP content null
Return success {
"errno": 0,
"error":”succ”}
Description

8.5 Get Picture

HTTP method GET
URL $url
HTTP header null
URL parameter null
HTTP content null
Return success return picture data
Description $url returned from an interface in 9.2 or 9.3

9. Query the Boot Machine Address

HTTP method GET
URL http://API_ADDRESS/boot_address
HTTP header null
URL parameter null
HTTP content null
Return success {
"errno": 0,
"error": "succ",
“data”:
{
"boot_address": "183.230.40.42",
"boot_port": 9101
}
}
Description

10. Settting Product Video Encryption Switch

HTTP method PUT
URL http://API_ADDRESS/trans_encrypt
HTTP header api-key required
URL parameter product_id=7355//product id
HTTP content { "type": 0} 0 is unencrypted, 1 is encrypted
Return success {
"errno": 0,
"error": "succ"
}
Description

11. Get Product Encryption Status

HTTP method Get
URL http://API_ADDRESS/trans_encrypt
HTTP header api-key required
URL parameter product_id=7355//product id
HTTP Content null
Return success { "errno": 0, "trans_enc": 1}
Description

12. Device Data Transparent Transmission

HTTP method POST
URL http://API_ADDRESS/dev_active
HTTP header api-key required
URL parameter device_id =//Device ID
HTTP Content Custom, no more than 128 byte
Return success {
"errno": 0,//0 Command sent success
"error": "Succ"
}
Description Scenarios which the interface applies: Device needs to receive a fixed string
The protocol will not encrypt the string, and the serial number of the protocol header will be zero
The header string received by the device will be fixed and unchanged

13. Recording Interface

HTTP method GET
URL http://API_ADDRESS/record/record_video
HTTP header api-key required
URL parameter product_id=12
device_id=123
channel_id=12345
action=0/1, //0: stop recording 1: start recording, required
HTTP content
Return success {
"errno": 0,
"error": "succ"
}
Description product_id: product number, required parameter
device_id : device number, required parameter
channel_id : channel number, required parameter
action: operation type, 0: stop recording 1: start recording, required parameters

14.1 Video Information Acquisition

HTTP method GET
URL http://API_ADDRESS/vod/get_video_info

HTTP header|api-key required| |URL parameter|device_id=12,
channel_id=12,
video_id=”1112341234”
security=1 //Select secure playback link (https and rtmpe), and null, defualt to ordinary link| |HTTP content| | |Return success|{
"errno": 0,
"error": “succ”,
"data": {
"videoid":d afdafd
"name": "dad",
"start":"2017-01-12 12:01:12",
"end":"2017-01-12 15:01:12",
"size":"1234",// unit is Kbytes
"durtion":"12",// unit is second
"hls_url":"url",// http playback address
"rtmp_url":"url"//RTMP playback address
}
}| |Description|Playback address needs to carry token. For token get, see "Video on-demand token get"
The assembly method is hls: url?token= “token”, rtmp: url?token.
Hls adds a parameter token as the http url parameter, with the parameter value being the token content obtained.
The Rtmp protocol directly stitches the token content after “?”
Security defaults to 0, and returns normal play links (http and rtmp), and 1 indicates to return secure play links (https and rtmpe) |

14.2 Video List Get

HTTP method GET
URL http://API_ADDRESS/ vod/get_video_list
HTTP header api-key required
URL parameter device_id=12,
channel_id=12,
start_time=“2018-01-01 01:00:00”, // format string optional filter condition
end_time=“2018-01-01 01:00:00”, // format string optional filter condition
name=”111”, //optional filter conditions, filtered by name
page_start= 1, //paging start
page_size=1 //paging size
security=1 //Select secure playback link(https and rtmpe),null default to ordinary link
HTTP content
Return success {
"errno": 0,
"error":”succ”,
"data":{
"videos":[
{
"videoid":"dafdafd",
"name":"dad",
"start":"2017-01-12 12:01:12",
"end":"2017-01-12 15:01:12",
"size":1234,// unit is KBytes
"hls_url":"url",// http playback address
"rtmp_url":"url" // RTMP playback address
},
{….},
…..
]
}
"page_info":
{
"total_num":50,
"page_total":25,
"page_size":2,
"current_page":1
}
}
Description Select filter time can only fill start_time or end_time, and can also be fill both
The playback address needs to carry token. For token get, see "Video on-demand token get"
The assembly method is hls: url?token= “token”, rtmp: url?token.
HLS adds a parameter token in the means of http url parameter; the parameter value is the token content obtained.
The Rtmp protocol directly stitches the token content after “?”
Security defaults to 0, and returns normal play links (http and rtmp), and 1 indicates to return secure play links (https and rtmpe)

14.3 Video Deletion

HTTP method POST
URL http://API_ADDRESS/vod/delete_video
HTTP header api-key required
Content-Type:application/json
URL parameter deviceid=1,
channeled= 1
HTTP content {
"video": [{
"videoId": 1
},
{
"videoId": 2
}]
}
Return success {
"errno": 0,
"error":“succ”,
"data":
[
{ "code": 0}
{"code":1, "message":"not exist"}
]
}
Description Return message gives the result of each delete ID in the form of array, and if the deletion fails, it gives an error message that videoId must be a string

14.4 Video Rename

HTTP method PUT
URL http://API_ADDRESS/ vod/rename_video
HTTP Header api-key required
Content-Type:application/json
URL parameter device_id=12,
channel_id=12,
video_id=”1112341234”
HTTP content {“name” : “11111”}
Return success {
"errno": 0,
"error":”succ”,
}
Description

14.5 Video On-demand Token Get |HTTP method | GET| |:---|:---| |URL|http://API_ADDRESS/vod/get_play_token| |HTTP header|api-key required| |URL parameter|device_id=12,
channel_id=12,
video_id=”1112341234”| |HTTP content| | |Return success|{
"errno": 0,
"error":”succ”,
"data":{
"token": "sdafsa"
}
}| |Description|Token is used for on-demand related video acquisition|

15. Operation

Description: The following interfaces are in JOSN format:

Correct return:

{
"errno":0,
"error":"succ",
"result":[]
}

Erroneous return:

{
"errno":-1,
"error":"The Requested Parameter Is Invalid",
}

Errno equals to 0 indicates return correct
Not equals to 0 indicates an erroneous return, and error indicates specific error message.

15.1 Playback Record List Query

HTTP method GET
URL http://API_ADDRESS/stat/getonlinelist
HTTP header api-key required
Note: Only master-key can be used
URL parameter productid=//Product number required
deviceid =//Device ID
channelid=//channel number
protocoltype =//protocol type rtmp hls
page_key=//paging query usage
page_size=//the data queried per page
page= paging query use
HTTP content null
{
"errno":0,
"error":"succ",
"result":
[
{
"productid":7312,
"deviceid":2479989,
"channelid":1,
"protocoltype":"RTMP",
"clientip":"172.19.3.99",
"videocodec":"H264",
"resolution":"1280 720",
"fps":25,
"audiocodec":"",
"bandwidth":91392,
"onlinetime":"00:04:43"
},
{
"productid":7312,
"deviceid":2479989,
"channelid":2,
"protocoltype":"RTMP",
"clientip":"172.19.3.99",
"videocodec":"H264",
"resolution":"1280
720",
"fps":25,
"audiocodec":"",
"bandwidth":63066,
"onlinetime":"00:07:00"
}
],
"page_info":
{
"total_num":3,
"page_total":2,
"page_size":2,
"current_page":1,
"page_key":"fc94c7c4-0760-4523-876c-5583260520c6"
}
}
Description 1) for real-time query, data queries after the first page need to be passed in page_key
2) The paging data server is cached for only 5 minutes, and it will be expired after 5 minutes

15.2 Push-stream Record List Query

HTTP method GET
URL http://API_ADDRESS/stat/getpushlist
HTTP Header api-key required
Note: Only master-key can be used
URL parameter productid=//Product number required
deviceid =//device ID
channelid=//channel number
page_key=//paging query usage
page_size=//the data queried per page
page= paging query use
HTTP content null
Return success {
"errno":0,
"error":"succ",
"result":
[
{
"productid":7312,
"deviceid":2479989,
"channelid":3,
"protocoltype":"RTMP",
"puship":"172.19.3.98",
"videocodec":"H264",
"resolution":"640 480",
"fps":25,
"audiocodec":"AAC",
"bandwidth":95230,
"pushtime":"00:06:37"
},
{
"productid":7312,
"deviceid":2479989,
"channelid":1,
"protocoltype":"RTMP",
"puship":"172.19.3.98",
"videocodec":"H264",
"resolution":"1280
720",
"fps":25,
"audiocodec":"",
"bandwidth":91020,
"pushtime":"00:04:43"
}
],
"page_info":
{
"total_num":3,
"page_total":2,
"page_size":2,
"current_page":1,
"page_key":"5931b760-864a-44fb-9dd0-558e7caaace0"
}
}
Description paging queries are handled in a consistent manner with the list of play records

15.3 Camera Disable/Enable Interface

HTTP method PUT
URL http://API_ADDRESS/access_control/closecamera
HTTP header api-key required
URL parameter product_id=12,//Product id
device_id=123, //device id
id="1",//Camera ID
HTTP content {
"type":1, //1 is off, 0 is open
}
Return success {
"errno": 0,
"error":“succ”
}

15.4 Device Historical Statistics Query

HTTP method GET
URL http:// /stat/getdevicestat
HTTP header api-key required
Note: Only master-key can be used
URL parameter productid=//Product number required
deviceid =//Device ID
start_time=//start statistic time required format:“2017-11-08 00:00:00”
end_time=//end statistic time required format:“2017-11-08 23:59:59”
page=// required, check the page
pagesize=//required, not more than 500, the number of queries per page
HTTP content null
Return success {
"errno":0,
"error":"succ",
"result":
[
{
"stat_time":"2017-11-08 10:23:50",
"productid":1990,
"deviceid":2165845,
"totalpush":2,
"rtmpplay":2,
"hlsplay":0,
"rtmpupbw":154612,
"hlsupbw":0,
"rtmpdownbw":153706,
"hlsdownbw":0
},
{
"stat_time":"2017-11-08 10:24:50",
"productid":1990,
"deviceid":2165845,
"totalpush":2,
"rtmpplay":2,
"hlsplay":0,
"rtmpupbw":155907,
"hlsupbw":0,
"rtmpdownbw":155625,
"hlsdownbw":0
}
],
"page_info":
{
"total_num":50,
"page_total":25,
"page_size":2,
"current_page":1
}
}
Description

15.5 Product History Statistics Query

HTTP method GET
URL http://API_ADDRESS/stat/getproductstat
HTTP header api-key required
Note: Only master-key can be used
URL parameter productid=//Product number required
start_time=//start statistic time required format:“2017-11-08 00:00:00”
end_time=//end statistic time required format:“2017-11-08 23:59:59”
page=//required, query the page
pagesize=//required, not more than 500, the number of queries per page
HTTP conten null
Return success {
"errno":0,
"error":"succ",
"result":
[
{
"stat_time":"2017-11-08 10:23:50",
"productid":1990,
"totalpush":2,
"rtmpplay":2,
"hlsplay":0,
"rtmpupbw":123456789123456800,
"hlsupbw":0,
"rtmpdownbw":153706,
"hlsdownbw":0
},
{
"stat_time":"2017-11-08 10:24:50",
"productid":1990,
"totalpush":2,
"rtmpplay":2,
"hlsplay":0,
"rtmpupbw":155907,
"hlsupbw":0,
"rtmpdownbw":155625,
"hlsdownbw":0
}
],
"page_info":
{
"total_num":50,
"page_total":25,
"page_size":2,
"current_page":1
}
}
Description

15.6 Product Real-time Summary Query

HTTP method GET
URL http://API_ADDRESS/stat/getproductsummary
HTTP header api-key required
Note: Only master-key can be used
URL parameter productid=//Product number required
HTTP content null
Return success {
"errno": 0,
"error": “succ”,
"result": [
{
“productid”:123456 //product ID
"pushnum":10 //Current total push-flow camera number
“clientnum”500//number of current total online clients
}
]
}
Description

15.7 Save Management Configuration Interface

15.7.1 Video Storage Package Query

HTTP method GET
URL http://API_ADDRESS/storage/product_scheme_info
HTTP header api-key required
URL parameter product_id = 1,
device_id=12, //Optional parameters
channel_id=1, //optional parameter, does not return all channels under the device
Status=1, //optional parameters,
Page_start=1,
page_size=10
HTTP content
Return success {
"errno": 0,
"error": “succ”
, "total": 0,
"scheme": [
{
"scheme_id": 1,
"type": 1, //1. loop record, 2. Scheduled record
"device_id": 1,
"channel_id": 1,
"status": 1, //1: In use, 2: Frozen, 3: Expired
"start_time": "format time string ", Start time
"expire_time": "format time string", Expiration time
"param": {} // package parameters, see instructions
}
],
"Page_info":
{
"total_num": 50,
"Page_total": 25,
"Page_size": 2,
"Current_page": 1
}

}
Description param Format
Loop record:
{
"Cycle": 7, //Loop record days, 7 days loop record
"expire": 30, //validity days,
30-day Month card, 90-day season card, 365-day year card
}

Timed recording:
{
" schedule ":
{
"moday": [{
"start_time": "01:00",
"end_time": "02:00"
}]
},
{
"sunday": [{
"start_time": "01:00",
"end_time": "02:00"
}]
}
}

15.7.2 Timed recording schedule updates

HTTP method PUT
URL http://API_ADDRESS/storage/update_record_schedule
HTTP header api-key required
content-type:application/json
URL parameter device_id=12,
channel_id=1
HTTP content {
"schedule": [
{
"monday":[{
"start_time":"01:00",
"end_time":"02:00"
}]
},
{"sunday":[{
"start_time":"01:00",
"end_time":"02:00"
}]
}
}
}
Return success {
"errno": 0,
"error":"succ"
}
Description can only be modified if the type is timed recording, otherwise return fails

15.7.3 Latest Package Enquiry

HTTP method GET
URL http://API_ADDRESS/storage/current_scheme
HTTP header api-key required
URL parameter device_id=12,
channel_id=1
HTTP content
Return success {
"errno": 0,
"error":”succ”,
"total": 0,
"scheme": {
"scheme_id": 1,
"type": 1, //1. Cyclic recording, 2. Scheduled recording
"device_id": 1 ,
"channel_id": 1,
"status": 1, //1: In use, 2: Frozen, 3: Expired
"start_time": "format time string ", Start time
"expire_time": “format time string ”, Expiration time
"param": {}//package parameters, see instructions
}
Description param Format
Loop recording:
{
"Cycle": 7, //Cycle recording days, 7 days cycle recording
"expire": 30, //validity days,
30-day month card, 90-day season card, 365-day year card
}

Timed recording:
{
"schedule":
{
"moday": [{
"start_time": "01:00",
"end_time": "02:00"
}]
},
{
"sunday": [{
"start_time": "01:00",
"end_time": "02:00"
}]
}
}

results matching ""

    No results matching ""