简体中文

Nebula Functions v1.2a - page 1_2

Change logs

VersionChange log
1.0.1Remove the incorrect string “IOTCAV:” from AV JSON control request example
1.0.2Correct “values” to “value” in queryEventList response
1.0.2Correct “Authentication” to “Authorization” in addPushNotificationService & setCloudRecordingEndpoint
1.0.2Add notes for playbackControl “pause”
1.0.2Remove “failIfExist” in createCredential and add some description
1.0.2Use MB as unit in getStorageInfo
1.1Add functions for WebRTC
1.1Add functions for NVR & DVR
1.2Add function getGeoLocation
1.2Add function startWebRtcEx
1.2Add function triggerLocalRecording & triggerCloudRecording

Introduction

Functions

IOTCAV:startVideo

Description: Use this function to request the device to start playing video stream with AV JSON control. Please note that “IOTCAV:” should be removed from the control string before sending it.
Version: 1.0
Function set: IOTCAV:videoStreaming
Request parameters:

Parameter nameData typeRequirementDescription
valueBooleanMtrue: request the device to start playing video, false: request the device to stop playing video
videoFormatPresetStringOplease check getCameraCapability for the information of video format presets

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"IOTCAV:startVideo",
  "args":{
    "value":"Boolean",
    "videoFormatPreset":"String"
  }
}

AV JSON control request example:

{
  "func":"startVideo",
  "args":{
    "value": true
  }
}

AV JSON control response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

IOTCAV:startAudio

Description: Use this function to request the device to start playing audio stream with AV JSON control. Please note that “IOTCAV:” should be removed from the control string before sending it.
Version: 1.0
Function set: IOTCAV:audioStreaming
Request parameters:

Parameter nameData typeRequirementDescription
valueBooleanMtrue: request the device to start playing audio, false: request the device to stop playing audio

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"IOTCAV:startAudio",
  "args":{
    "value":"Boolean"
  }
}

AV JSON control request example:

{
  "func":"startAudio",
  "args":{
    "value": true
  }
}

AV JSON control response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

IOTCAV:startSpeaker

Description: Use this function to request the device to recieve audio stream from client. Please note that “IOTCAV:” should be removed from the control string before sending it.
Version: 1.0
Function set: IOTCAV:speaker
Request parameters:

Parameter nameData typeRequirementDescription
valueBooleanMtrue: request the device to start recieving audio, false: request the device to stop recieving audio

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"IOTCAV:startSpeaker",
  "args":{
    "value":"Boolean"
  }
}

AV JSON control request example:

{
  "func":"startSpeaker",
  "args":{
    "value": true
  }
}

AV JSON control response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

IOTCAV:playbackControl

Description: Use this function to request the device to start playing video stream with AV JSON control. Please note that “IOTCAV:” should be removed from the control string before sending it.
Version: 1.0
Function set: IOTCAV:playback
Request parameters:

Parameter nameData typeRequirementDescription
ctrlIntM
fileNameStringM
iotcChannelIntOdevice should use channel 1 in default
Enumeration of ctrldescriptionnote
0pauseDevice should continue to play video stream after receiving control “play” not “pause”
1play
2stop

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"IOTCAV:playbackControl",
  "args":{
    "ctrl":"Int",
    "fileName":"String",
    "iotcChannel":"Int"
  }
}

AV JSON control request example:

{
  "func":"playbackControl",
  "args":{
    "ctrl":1,
    "fileName":"20201229.h264",
    "iotcChannel":2
  }
}

AV JSON control response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

getVideoFormatPreset

Description: Use this function to get the currently utilized video format present, please check getCameraCapability for the information of video format presets.
Version: 1.0
Function set: videoConfiguration
Request parameters:

Parameter nameData typeRequirementDescription
channelIntOFor NVR, DVR devices

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
valueStringMPresent name

Device profile example:

{
  "func":"getVideoFormatPreset",
  "args":{
      "channel":"Int"
  },
  "return":{
    "value":"String"
  }
}

Nebula command request example:

{
  "func":"getVideoFormatPreset",
  "args":{
    "channel":1
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "value": "hd"
  }
}

setVideoFormatPreset

Description: Use this function to set the current video format present, please check getCameraCapability for the information of video format presets.
Version: 1.0
Function set: videoConfiguration
Request parameters:

Parameter nameData typeRequirementDescription
valueStringMPresent name
channelIntOFor NVR,DVR devices

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"setVideoFormatPreset",
  "args":{
    "value":"String",
    "channel":"Int"
  }
}

Nebula command request example:

{
  "func":"setVideoFormatPreset",
  "args":{
    "value":"720p",
    "channel":1
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

getVideoBrightness

Description: Get the brightness value of the video stream.
Version: 1.0
Function set: videoConfiguration
Request parameters:

Parameter nameData typeRequirementDescription
channelIntOsupport in v1.2

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
valueIntMvalue range is 0-100

Device profile example:

{
  "func":"getVideoBrightness",
  "args":{
    "channel":"Int"
  },
  "return":{
    "value":"Int"
  }
}

Nebula command request example:

{
  "func":"getVideoBrightness"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
  "content":{
    "value": 57
  }
}

setVideoBrightness

Description: Set the brightness value of the video stream.
Version: 1.0
Function set: videoConfiguration
Request parameters:

Parameter nameData typeRequirementDescription
valueIntMvalue range is 0-100
channelIntOsupport in v1.2

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"setVideoBrightness",
  "args":{
    "value":"Int",
    "channel":"Int"
  }
}

Nebula command request example:

{
  "func":"setVideoBrightness",
  "args":{
    "value":99
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

getVideoContrast

Description: Get the contrast value of the video stream.
Version: 1.0
Function set: videoConfiguration
Request parameters:

Parameter nameData typeRequirementDescription
channelIntOsupport in v1.2

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
valueIntMvalue range is 0-100

Device profile example:

{
  "func":"getVideoContrast",
  "args":{
    "channel":"Int"
  },
  "return":{
    "value":"Int"
  }
}

Nebula command request example:

{
  "func":"getVideoContrast"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "value": 67
  }
}

setVideoContrast

Description: Set the contrast value of the video stream.
Version: 1.0
Function set: videoConfiguration
Request parameters:

Parameter nameData typeRequirementDescription
valueIntMvalue range is 0-100
channelIntOsupport in v1.2

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"setVideoContrast",
  "args":{
    "value":"Int",
    "channel":"Int"
  }
}

Nebula command request example:

{
  "func":"setVideoContrast",
  "args":{
    "value":67
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

setCloudRecordingEndpoint

Description: Setup target could recording url of the device, this function is supported internally by Nebula Device.
Version: 1.2
Function set: cloudRecording
Request parameters:

Parameter nameData typeRequirementDescription
urlStringMURL of VSaaS server
intentionStringOEnumeration of “subscribe”, “cancel”, “modify”
headerDictionaryOall content will be put in the http header
channelIntegerOspecific channel that this endpoint belongs to, only given for devices that supports channels
recordingTypeStringOspecific recording type that is supported by this endpoint. Will be either “fulltime” or “event”

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"setCloudRecordingEndpoint",
  "args":{
    "url":"String",
    "header":"Dictionary"
  }
}

Nebula command request example no channel old format:

{
  "func":"setCloudRecordingEndpoint",
  "args":{
    "url":"https://vpbs-rd.kalay.us/vsaas/api/v1/stream/stream_url/TC021LBP010000000001LBG10KXETTV8DUMFM111?stoken=r43rjio4jrin3o3r",
    "header": {
      "Authorization":"Bearer XXXXXXXXX",
      "User-Agent":"TUTK Device"
    }
  }
}

Nebula command request example no channel:

{
  "func": "setCloudRecordingEndpoint",
  "args": {
    "url": "https://asia-vpapi-tutk-stg.kalay.us/vsaas/api/v1/stream/stream_url/EBYUANJMU3L4UM6GU1EJ?stoken=stoken",
    "header": {
    "Authorization": "Bearer XXXXXXXXX",
        "User-Agent": "TUTK Device"
    },
    "recordingType": "event",
    "intension": "subscribe"
  }
}

Nebula command request example with channel:

{
  "func": "setCloudRecordingEndpoint",
  "args": {
    "url": "https://asia-vpapi-tutkstg.kalay.us/vsaas/api/v1/stream/stream_url/EBYUANJMU3L4UM6GU1EJstoken=stoken",
    "header": {
    "Authorization": "Bearer XXXXXXXXX",
        "User-Agent": "TUTK Device"
    },
    "channel": 1,
    "intension": "subscribe",
    "recordingType": "fulltime"
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

getCloudRecordingEndpoint

Description: To retrieve the cloud recording URL of the device, you can use the internal SDK function ‘getCloudRecordingEndpoint’
Version: 1.3
Function set: cloudRecording
Request parameters:

Parameter nameData typeRequirementDescription
channelIntegerOonly given for devices that supports channels

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
urlStringMURL of VSaaS server
headerDictionaryOall content will be put in the http header
channelIntegerOspecific channel that this endpoint belongs to, only given for devices that supports channels
recordingTypeStringOspecific recording type that is supported by this endpoint. Will be either “fulltime” or “event”

Device profile example:

{
  "func":"getCloudRecordingEndpoint",
  "return":{
    "url":"String",
    "header":"Dictionary",
    "channel" int,
    "recordingType": "String"
  }
}

Nebula command request example:

{
  "func":"getCloudRecordingEndpoint"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":
  {
    "url":"https://vpbs-rd.kalay.us/vsaas/api/v1/stream/stream_url/TC021LBP010000000001LBG10KXETTV8DUMFM111?stoken=r43rjio4jrin3o3r",
    "header": {
      "Authorization":"Bearer XXXXXXXXX",
      "User-Agent":"TUTK Device"
    }
  }
}

Nebula command response example no channel:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":
  {
    "url":"https://vpbs-rd.kalay.us/vsaas/api/v1/stream/stream_url/TC021LBP010000000001LBG10KXETTV8DUMFM111?stoken=r43rjio4jrin3o3r",
    "header": {
      "Authorization":"Bearer XXXXXXXXX",
      "User-Agent":"TUTK Device"
    },
    "recordingType":"fulltime"
  }
}

Nebula command response example with channel:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":
  {
    "url":"https://vpbs-rd.kalay.us/vsaas/api/v1/stream/stream_url/TC021LBP010000000001LBG10KXETTV8DUMFM111?stoken=r43rjio4jrin3o3r",
    "header": {
      "Authorization":"Bearer XXXXXXXXX",
      "User-Agent":"TUTK Device"
    },
    "channel": 1,
    "recordingType":"event"
  }
}

enableCloudRecording

Description: Turn on/off the cloud recording functionality of the device.
Version: 1.0
Function set: cloudRecording
Request parameters:

Parameter nameData typeRequirementDescription
valueBooleanMtrue is turn on , false is off

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"enableCloudRecording",
  "args":{
    "value":"Boolean"
  }
}

Nebula command request example:

{
  "func":"enableCloudRecording",
  "args":{
    "value":true
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

getCloudRecordingStatus

Description: Get the on/off status of the cloud recording functionality of the device
Version: 1.0
Function set: cloudRecording
Request parameters: Empty
Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
valueBooleanMtrue is turn on the cloud recording , false is turn off.

Device profile example:

{
  "func":"getCloudRecordingStatus",
  "return":{
    "value":"Boolean"
  }
}

Nebula command request example:

{
  "func":"getCloudRecordingStatus"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "value":true
  }
}

getCameraCapability

Description: Get the capabilities of a camera.
Version: 1.0
Function set: cameraInfo
Request parameters: Empty
Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
channelsArray of channel objectMCapabilities for each iotc channel
The elements of a channel objectData typeRequirementDescription
protocolsArray of StringMcould be “iotc-av”,“rtsp-iotc-tunnel”,“webrtc”
channelIdIntM
lenslens objectM
videovideo objectM
audioaudio objectO
speakerspeaker objectO
The elements of a lens objectData typeRequirementDescription
typeStringM
The elements of a video objectData typeRequirementDescription
codecsArray of StringMcould be h264, h265, mjpeg
averageBitratesArray of IntM
presetsArray of video preset objectM
The elements of an audio/speaker objectData typeRequirement
presetsArray of audio preset objectM
The elements of an video preset objectData typeRequirementDescription
nameStringMPreset name
codecStringMh264, h265, mjpeg
averageBitrateIntMUnit: bps
resolutionStringM1920x1080, 1024x768,…
The elements of an audio/speaker preset objectData typeRequirementDescription
nameStringMPreset name
codecStringMpcm, g711u, g711u, aac
sampleRateIntM8000, 16000, …44100
bitsPerSampleIntM8, 16, 24
channelCountIntM1, 2
Possible strings of the lens type
fisheye
wideAngle
normal

Device profile example:

{
  "func": "getCameraCapability",
  "return": {
    "channels": [
      {
        "protocols": [
          "String"
        ],
        "channelId": "Int",
        "lens": {
          "type": "String"
        },
        "video": {
          "presets": [
            {
              "name": "String",
              "codec": "String",
              "averageBitrate": "Int",
              "resolution": "String"
            }
          ],
          "codecs": [
            "String"
          ],
          "averageBitrates": [
            "Int"
          ]
        },
        "audio": {
          "presets": [
            {
              "name": "String",
              "codec": "String",
              "sampleRate": "Int",
              "bitsPerSample": "Int",
              "channelCount": "Int"
            }
          ]
        },
        "speaker": {
          "presets": [
            {
              "name": "String",
              "codec": "String",
              "sampleRate": "Int",
              "bitsPerSample": "Int",
              "channelCount": "Int"
            }
          ]
        }
      }
    ]
  }
}

Nebula command request example:

{
  "func":"getCameraCapability"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content": {
    "channels": [
      {
        "protocols": [
          "iotc-av",
          "rtsp-iotc-tunnel"
        ],
        "channelId": 0,
        "lens": {
          "type": "normal"
        },
        "video": {
          "codecs": [
            "h264",
            "h265"
          ],
          "averageBitrates": [
            100000,
            500000
          ],
          "presets": [
            {
              "name": "720p",
              "codec": "h264",
              "averageBitrate": 100000,
              "resolution": "1280×720"
            },
            {
              "name": "1080p",
              "codec": "h264",
              "averageBitrate": 500000,
              "resolution": "1920x1080"
            }
          ]
        },
        "audio": {
          "presets": [
            {
              "name": "pcm_8000_16_1",
              "codec": "pcm",
              "sampleRate": 8000,
              "bitsPerSample": 16,
              "channelCount": 1
            }
          ]
        },
        "speaker": {
          "presets": [
            {
              "name": "speaker_1",
              "codec": "pcm",
              "sampleRate": 8000,
              "bitsPerSample": 16,
              "channelCount": 1
            }
          ]
        }
      },
      {
        "protocols": [
          "iotc-av",
          "rtsp-iotc-tunnel"
        ],
        "channelId": 1,
        "lens": {
          "type": "normal"
        },
        "video": {
          "codecs": [
            "h264",
            "h265"
          ],
          "averageBitrates": [
            100000,
            500000
          ],
          "presets": [
            {
              "name": "720p",
              "codec": "h264",
              "averageBitrate": 100000,
              "resolution": "1280×720"
            },
            {
              "name": "1080p",
              "codec": "h264",
              "averageBitrate": 500000,
              "resolution": "1920x1080"
            }
          ]
        }
      }
    ]
  }
}

setWifi

Description: update the wifi configuration of the device
Version: 1.0
Function set: wifi
Request parameters:

Parameter nameData typeRequirementDescription
ssidStringM
pwdStringM

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func": "setWifi",
  "args": {
    "ssid": "String",
    "pwd":"String"
  }
}

Nebula command request example:

{
  "func": "setWifi",
  "args": {
    "ssid": "TestAP",
    "pwd":"12345678"
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

queryWifiList

Description: The device will scan the wifi aps and provide the results to the client
Version: 1.0
Function set: wifi
Request parameters: Empty
Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
listArray of wifi objectM
element of wifi objectData typeRequirementDescription
ssidStringM
signalfloatOunit: dbm

Device profile example:

{
  "func": "queryWifiList",
  "return": {
    "list":[{
        "ssid":"String",
        "signal":"Float"
    }]
  }
}

Nebula command request example:

{
  "func": "queryWifiList"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content": {
    "list":[
      {
        "ssid":"TestAP1",
        "signal": -50.1
      },
      {
        "ssid":"TestAP2",
        "signal": -30.2
      }
    ]
  }
}

getCurrentWifi

Description: Get the wifi ssid currently used by the device
Version: 1.0
Function set: wifi
Request parameters: Empty
Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
ssidStringM
signalFloatOunit: dbm

Device profile example:

{
  "func": "getCurrentWifi",
  "return": {
    "ssid": "String",
    "signal": "Float"
  }
}

Nebula command request example:

{
  "func": "getCurrentWifi"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content": {
    "ssid": "TestAP",
    "signal": -90.0
  }
}

queryStorageList

Description: Query all the storage infos of the device
Version: 1.0
Function set: storageInfo
Request parameters: Empty
Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
listString arrayM

Device profile example:

{
  "func":"queryStorageList",
  "return":{
    "list":["String"]
  }
}

Nebula command request example:

{
  "func":"queryStorageList"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content": {
    "list":["sdcard", "usb"]
  }
}

getStorageInfo

Description: Get more information of the target storage through its name
Version: 1.0
Function set: storageInfo
Request parameters:

Parameter nameData typeRequirementDescription
valueStringM

Response status code:

status codeDescription
200OK
400Invalid parameter or this command is not supported by the device
404Storage not found
415Storage format not support
422Storage not formatted
423Storage is not writtable due to some reason

Response content:

Parameter nameData typeRequirementDescription
totalSizeIntMunit: MByte
freeSizeIntMunit: MByte
formatStringO“exFAT”,“vFAT”,“NFTS”

Device profile example:

{
  "func":"getStorageInfo",
  "args":{
    "value":"String"
  },
  "return":{
    "totalSize":"Int",
    "freeSize":"Int",
    "format":"String"
  }
}

Nebula command request example:

{
  "func":"getStorageInfo",
  "args":{
    "value":"sdcard"
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content": {
    "totalSize":64000,
    "freeSize":32000,
    "format":"exFAT"
  }
}

formatStorage

Description: Format the target storage through its name
Version: 1.0
Function set: storageInfo
Request parameters:

Parameter nameData typeRequirementDescription
valueStringM

Response status code:

status codeDescription
200OK
400Invalid parameter or this command is not supported by the device
404Storage not found
405Format storage failed

Response content: Empty
Device profile example:

{
  "func":"formatStorage",
  "args":{
    "value":"String"
  }
}

Nebula command request example:

{
  "func":"formatStorage",
  "args":{
    "value":"sdcard"
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

createCredential

Description: This function is used to create a new identity name with a new credential, or to overwrite the credential already exists through its identity name
Version: 1.0
Function set: authentication
Request parameters:

Parameter nameData typeRequirementDescription
identityStringM
createModeStringM
Possible strings of createModedescription
createIfNotExistCreate new credential if not exist, return old credential if exist
updateIfExistCreate update credential if exist, return error if not exist

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"createCredential",
  "args":{
    "identity":"String",
    "createMode":"String"
  },
  "return":{
    "credential":"String"
  }
}

Nebula command request example:

{
  "func":"createCredential",
  "args":{
    "identity":"guest",
    "createMode":"createIfNotExist"
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "credential":"doen43rniosqwsni"
  }
}

deleteCredential

Description: This function is used to delete a credential through its identity name
Version: 1.0
Function set: authentication
Request parameters:

Parameter nameData typeRequirementDescription
identityStringM

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"deleteCredential",
  "args":{
    "identity":"String"
  }
}

Nebula command request example:

{
  "func":"deleteCredential",
  "args":{
    "identity":"guest"
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

getAllIdentities

Description: This function is used to enumerate all the identities
Version: 1.0
Function set: authentication
Request parameters:

Parameter nameData typeRequirementDescription
identitiesString arrayM

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"getAllIdentities",
  "return":{
    "identities":["String"]
  }
}

Nebula command request example:

{
  "func":"getAllIdentities"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "identities":["admin","guest","user1"]
  }
}

getDeviceInfo

Description: This function is used to get the infomation of the device
Version: 1.0
Function set: deviceInfo
Request parameters: Empty
Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
skuNumberStringMFill it up empty string if the device does not have this infomation
serialNumberStringMFill it up empty string if the device does not have this infomation
modelStringM
macStringMthe format should be like “D8:23:F4:2D:22:CE”
nameStringMdevice name
ipStringM
typeStringMdevice type

Device profile example:

{
  "func":"getDeviceInfo",
  "return":{
    "skuNumber":"String",
    "serialNumber":"String",
    "model":"String",
    "mac":"String",
    "name":"String",
    "ip":"String",
    "type":"String"
  }
}

Nebula command request example:

{
  "func":"getDeviceInfo"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "skuNumber":"234-324",
    "serialNumber":"4mk234j",
    "model":"TUTKIPC01",
    "mac":"D8:23:F4:2D:22:CE",
    "name":"ipcam",
    "ip":"192.168.1.2",
    "type":"camera"
  }
}

setName

Description: This function is used to set the name of the device
Version: 1.0
Function set: deviceInfo
Request parameters:

Parameter nameData typeRequirementDescription
nameStringM

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"setName",
  "args":{
    "name":"String"
  }
}

Nebula command request example:

{
  "func":"setName",
  "args":{
    "name":"front door ipcam"
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

getName

Description: This function is used to get the name of the device
Version: 1.0
Function set: deviceInfo
Request parameters: Empty
Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
nameStringM

Device profile example:

{
  "func":"getName",
  "return":{
    "name":"String"
  }
}

Nebula command request example:

{
  "func":"getName"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "name":"front door ipcam"
  }
}

getBatteryLevel

Description: This function is used on battery-powered devices to get the level of the battery
Version: 1.0
Function set: battery
Request parameters: Empty
Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
valueIntMthe battery percentage

Device profile example:

{
  "func":"getBatteryLevel",
  "return":{
    "value":"Int"
  }
}

Nebula command request example:

{
  "func":"getBatteryLevel"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "value":100
  }
}

addPushNotificationService

Description: It is an internal command supported by nebula SDK to add push notification api into SDK and the device should call related nebula SDK API to send out push notification. A device might have multiple push destinations, we use service to distinguish those destinations.
Version: 1.0
Function set: pushNotification
Request parameters:

Parameter nameData typeRequirementDescription
serviceStringM
urlStringM
headerStringO
methodString arrayOPOST or GET, default value is GET
supportImageUploadBooleanOdefault value is false

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"addPushNotificationService",
  "args":{
    "service": "String",
    "url":"String",
    "method":["String"],
    "supportImageUpload": "Boolean",
    "header": "Dictionary"
  }
}

Nebula command request example:

{
  "func":"addPushNotificationService",
  "args":{
    "service": "tutk-push",
    "url":"https://tutk.push.com/ewmkrlewmrl/token=j45ntj4n5tjk4ntj",
    "header": {
      "Authorization":"Bearer XXXXXXXXX",
      "User-Agent":"TUTK Device"
    }
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

delPushNotificationService

Description: It is an internal command supported by nebula SDK to remove push notification api stored in SDK.
Version: 1.0
Function set: pushNotification
Request parameters:

Parameter nameData typeRequirementDescription
serviceStringM

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"delPushNotificationService",
  "args":{
    "service": "String"
  }
}

Nebula command request example:

{
  "func":"delPushNotificationService",
  "args":{
    "service": "tutk-push"
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

queryPushNotificationService

Description: It is an internal command supported by nebula SDK to get all the push destinations stored in nebula SDK with service names.
Version: 1.2
Function set: pushNotification
Request parameters:
Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
listpush-info object arrayM
elements of push-info objectData typeRequirementDescription
serviceStringM
urlStringM
headerStringO

Device profile example:

{
  "func":"queryPushNotificationService",
  "return": {
    "list": [
      {
        "service": "String",
        "url":"String",
        "header": "Dictionary"
      }
    ]
  }
}

Nebula command request example:

{
  "func":"queryPushNotificationService"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content": {
    "list": [
      {
        "service": "tutk-push",
        "url":"https://tutk.push.com/ewmkrlewmrl/token=j45ntj4n5tjk4ntj",
        "header": {
          "Authorization":"Bearer XXXXXXXXX",
          "User-Agent":"TUTK Device"
        }
      },
      {
        "service": "other-push",
        "url":"https://tutk.push.com/ewmkrlewmrl/token=j45ntj4n5tjk4ntj",
        "header": {
          "Authorization":"Bearer XXXXXXXXX",
          "User-Agent":"TUTK Device"
        }
      },
    ]
  }
}

upgradeFirmware

Description: Use this command to trigger the firmware upgrade process.
Version: 1.0
Function set: ota
Request parameters:

Parameter nameData typeRequirementDescription
urlStringM
autoBooleanMWrite firmware directly after firmware is downloaded or not

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"upgradeFirmware",
  "args":{
    "url":"String",
    "auto": "Boolean"
  }
}

Nebula command request example:

{
  "func":"upgradeFirmware",
  "args":{
    "url":"https://kota.kalayservice.com/ota/GET/i/Company/Product/Model",
    "auto": true
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

checkFirmwareUpgradeStatus

Description: Check the firmware upgrade status.
Version: 1.0
Function set: ota
Request parameters: Empty
Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
statusIntM
progressBarIntOIt only works with status(1) and status(3) and its value range is 0~100. When it works with status(3), the value means the progress percentage of writing firmware
Enumeration of statusdescription
0Firmware upgrade is not in progress
1Downloading firmware.
2Firmware upgrade failed
3Firmware has been downloaded. If APP sned upgradeFireware with auto=true, status 3 also means the FW is being written into the flash.

Device profile example:

{
  "func":"checkFirmwareUpgradeStatus",
  "return":{
    "status":"Int",
    "progressBar":"Int"
  }
}

Nebula command request example:

{
  "func":"checkFirmwareUpgradeStatus"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "status":1,
    "progressBar":50
  }
}

writeFirmware

Description: This command should be used when “auto” is not enabled with “upgradeFirmware” it will start to write the firmware. Otherwise, the device will not write firmware automatically.
Version: 1.0
Function set: ota
Request parameters: Empty
Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"writeFirmware"
}

Nebula command request example:

{
  "func":"writeFirmware"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

getAllSettings

Description: This is a special command that can get multiple result of commands to avoid multiple times of command request.
Version: 1.0
Function set: allSettings
Request parameters: Empty
Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
settingsDictionaryMthe key value of the settings dictionary should be recognized by client, otherwise the client must skip to read its value

Device profile example:

{
  "func":"getAllSettings",
  "return":{
    "settings":"Dictionary"
  }
}

Nebula command request example:

{
  "func":"getAllSettings"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "settings":{
      "func1":"value1",
      "func2":2,
      "func3":true,
      "someID1":"value1",
      "someID2":2
    }
  }
}

panTiltStep

Description: Use this command to move the camera
Version: 1.0
Function set: ptzControl
Request parameters:

Parameter nameData typeRequirementDescription
stepIntM
directionStringMDetail see “Enumeration of direction”
channelIntOadded in spec 1.2, NVR’s channel usage. if for IPC, it does not need to have channel parameter
Enumeration of direction
up
down
left
right

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"panTiltStep",
  "args":{
    "step":"Int",
    "direction":"String",
    "channel":"Int"
  }
}

Nebula command request example:

{
  "func":"panTiltStep",
  "args":{
    "step":8,
    "direction":"up",
    "channel":1
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

queryEventList

Description: To query the recorded event list
Version: 1.0
Function set: playback
Request parameters:

Parameter nameData typeRequirementDescription
startTimeIntMUNIX timestamp(unit: sec)
endTimeIntMUNIX timestamp(unit: sec)
eventTypeStringM
channelIntOsome devices have multiple channels, each channel has at least one camera. If your device do not support multiple channels, please do not add this field into your device profile
Enumeration of eventType
all
motion
alarm

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
valueArray of event objectsM

Elements of event object

Parameter nameData typeRequirementDescription
eventTypeStringMit has the same enumeration as the “eventType” in request parameters
timestampIntMstart time of the event in the format of UNIX timestamp(unit: sec)
durationIntMthe duration of the event (unit: ms)
fileNameStringMthe filename of the recorded video file related to the event
fileSizeIntMunit: byte

Device profile example:

{
  "func": "queryEventList",
  "args": {
    "startTime": "Int",
    "endTime": "Int",
    "eventType": "String",
    "channel": "Int"
  },
  "return": {
    "value": [
      {
        "eventType": "String",
        "timestamp": "Int",
        "duration": "Int",
        "fileName": "String",
        "fileSize": "Int"
      }
    ]
  }
}

Nebula command request example:

{
  "func": "queryEventList",
  "args": {
    "startTime": 1559692800, //05 June 2019 08:00:00 GMT +8:00
    "endTime": 1559779200,   //06 June 2019 08:00:00 GMT +8:00
    "eventType": "motion"
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "value":[
      {
        "eventType": "motion",
        "timestamp": 1559696400, //05 June 2019 09:00:00 GMT +8:00
        "duration": 60000,
        "fileName": "20190605_090000",
        "fileSize": 102400000
      },
      {
        "eventType": "motion",
        "timestamp": 1559754000, //06 June 2019 01:00:00 GMT +8:00
        "duration": 60000,
        "fileName": "20190606_010000",
        "fileSize": 102400000
      }
    ]
  }
}

startWebRtc

Description:
Version: 1.1
Function set: webrtc
Request parameters:

Parameter nameData typeRequirementDescription
disableAuthTurnBooleanM
amTokenStringO
realmStringO
infoObjectOUser defined data
channelsArray of channel objectM
The elements of a channel objectData typeRequirement
channelIdIntO
streamIdString arrayM

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
rtcIdIntM
usernameStringO
passwordStringO
ttlIntO
urisString arrayO

Device profile example:

{
  "func": "startWebRtc",
  "args": {
    "amToken": "String",
    "realm": "String",
    "disableAuthTurn": "Boolean",
    "info": "Object",
    "channels":[
      {
        "channelId":"Int",
        "streamId":[
          "String"
        ]
      }
    ]
  },
  "return": {
    "rtcId": "Int",
    "username": "String",
    "password": "String",
    "ttl": "Int",
    "uris": [
      "String"
    ]
  }
}

Nebula command request example:

{
  "func": "startWebRtc",
  "args": {
    "amToken": "ewrewrrwerdwed",
    "realm": "tutk",
    "disableAuthTurn": false,
    "channels":[
      {
        "channelId":0,
        "streamId":["camera1","camera2"]
      }
    ]
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content": {
    "rtcId": 123,
    "username": "user123",
    "password": "password123",
    "ttl": 60,
    "uris": [
      "www.turn.tutk.com"
    ]
  }
}

stopWebRtc

Description:
Version: 1.1
Function set: webrtc, webrtcEx
Request parameters:

Parameter nameData typeRequirementDescription
rtcIdIntM

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func": "stopWebRtc",
  "args": {
    "rtcId": "Int"
  }
}

Nebula command request example:

{
  "func": "stopWebRtc",
  "args": {
    "rtcId": 123
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

exchangeSdp

Description:
Version: 1.1
Function set: webrtc, webrtcEx
Request parameters:

Parameter nameData typeRequirementDescription
typeStringMMust fill up with “offer”
sdpStringM
rtcIdIntM

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
typeStringMMust fill up with “answer”
sdpStringM

Device profile example:

{
  "func": "exchangeSdp",
  "args": {
    "type": "String",
    "sdp": "String",
    "rtcId": "Int"
  },
  "return": {
    "type": "String",
    "sdp": "String"
  }
}

Nebula command request example:

{
  "func": "exchangeSdp",
  "args": {
    "type": "offer",
    "sdp": "v=0 o=- 20518 0 IN IP4 0.0.0.0 ...",
    "rtcId": 123
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content": {
    "type": "answer",
    "sdp": "v=0 o=-  16833 0 IN IP4 0.0.0.0 .."
  }
}

startWebRtcStreams

Description:
Version: 1.1
Function set: webrtc, webrtcEx
Request parameters:

Parameter nameData typeRequirementDescription
streamIdsString arrayM
rtcIdIntO
setupConnectionsetupConnection objectO

Elements of setupConnection object

element nameData typeRequirementDescription
typeStringM
sdpStringM
infoObjectO

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
setupConnectionResultsetupConnectionResult objectO
startStreamsResultsstartStreamsResults objectO

Elements of setupConnectionResult object

element nameData typeRequirementDescription
rtcIdIntM
typeStringM
sdpStringM
resultCodeIntM

Elements of startStreamsResults object

element nameData typeRequirementDescription
streamIdStringM
resultCodeIntM

Device profile example:

{
  "func": "startWebRtcStreams",
  "args": {
    "rtcId": "Int",
    "streamIds": [
      "String"
    ],
    "setupConnection": {
      "type": "String:offer",
      "sdp": "String",
      "info": "Object"
    }
  },
  "return": {
    "setupConnectionResult": {
      "rtcId": "Int",
      "type": "String:answer",
      "sdp": "String",
      "resultCode": "Int"
    },
    "startStreamsResults": [
      {
        "streamId": "String",
        "resultCode": "Int"
      }
    ]
  }
}

Nebula command request example:
case 1

{
  "func": "startWebRtcStreams",
  "args": {
    "rtcId": 123,
    "streamIds": [
      "video",
      "audio"
    ]
  }
}

case 2

{
  "func": "startWebRtcStreams",
  "args": {
    "streamIds": [
      "video",
      "audio"
    ],
    "setupConnection": {
      "type": "offer",
      "sdp": "v=0 o=-  16833 0 IN IP4 0.0.0.0 .."
    }
  }
}

Nebula command response example:
case 1

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content": {
    "startStreamsResults": [
      {
        "streamId": "video",
        "resultCode": 200
      },
      {
        "streamId": "audio",
        "resultCode": 200
      }
    ]
  }
}

case 2

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content": {
    "setupConnectionResult": {
      "rtcId": 123,
      "type": "answer",
      "sdp": "v=0 o=-  16833 0 IN IP4 0.0.0.0 ..",
      "resultCode": 200
    },
    "startStreamsResults": [
      {
        "streamId": "video",
        "resultCode": 200
      },
      {
        "streamId": "audio",
        "resultCode": 200
      }
    ]
  }
}

stopWebRtcStreams

Description:
Version: 1.1
Function set: webrtc
Request parameters:

Parameter nameData typeRequirementDescription
streamIdsString arrayM
rtcIdIntO

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
stopStreamsResultsstopStreamsResults object arrayM

Elements of stopStreamsResults object

Parameter nameData typeRequirementDescription
streamIdStringM
resultCodeIntM

Device profile example:

{
  "func": "stopWebRtcStreams",
  "args": {
    "rtcId": "Int",
    "streamIds": [
      "String"
    ]
  },
  "return": {
    "stopStreamsResults": [
      {
        "streamId": "String",
        "resultCode": "Int"
      }
    ]
  }
}

Nebula command request example:

{
  "func": "stopWebRtcStreams",
  "args": {
    "rtcId": 123,
    "streamIds": [
      "video",
      "audio"
    ]
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content": {
    "stopStreamsResults": [
      {
        "streamId": "video",
        "resultCode": 200
      },
      {
        "streamId": "audio",
        "resultCode": 200
      }
    ]
  }
}

getLiveCapabilities

Description:
Version: 1.1
Function set: liveStreaming
Request parameters: Empty
Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
protocolString arrayM
streamTypeString arrayM
channelsInt arrayO
Enumeration of protocol
webrtc
rtsp-iotc-tunnel
iotc-av
Enumeration of streamType
video
audio
subVideo
audioAndVideo
audioAndSubVideo

Device profile example:

{
    "func":"getLiveCapabilities",
    "return":{
        "protocol":["String"],
        "streamType":["String"],
        "channels":["Int"]
    }
}

Nebula command request example:

{
    "func":"getLiveCapabilities"
}

Nebula command response example:

{
    "statusCode": 200,
    "statusMsg": "OK",
    "content":{
        "protocol":["rtsp-iotc-tunnel","iotc-av", "webrtc"],
        "streamType":["video","audio","audioAndVideo", "subVideo"],
        "channels":[0,1,5]
    }
}

startLiveStream

Description:
Version: 1.1
Function set: liveStreaming
Request parameters:

Parameter nameData typeRequirementDescription
streamTypeStringM
preferProtocolString ArrayM
channelIntO

please check getLiveCapabilities for the enumeration of preferProtocol and streamType

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
urlStringM
protocolurl definition
rtsp-iotc-tunnelrtsp://iotc-tunnel:<remote port>/<rtsp path>
iotc-aviotc-av://<UDID or *>/<iotc channel id>/<audio or video>
webrtcwebrtc://<UDID or *>/<stream id>

Device profile example:

{
    "func":"startLiveStream",
    "args":{
        "channel":"Int",
        "streamType":"String",
        "preferProtocol":["String"]
    },
    "return":{
        "url":"String"
    }
}

Nebula command request example for rtsp:

{
    "func":"startLiveStream",
    "args":{
        "channel":1,
        "streamType":"video",
        "preferProtocol":["rtsp-iotc-tunnel"]
    }
}

Nebula command response example for rtsp:

{
    "statusCode": 200,
    "statusMsg": "OK",
    "content":{
        "url":"rtsp://iotc-tunnel:80/path/to/stream"
    }
}

Nebula command request example iotc-av:

{
    "func":"startLiveStream",
    "args":{
        "channel":1,
        "streamType":"subVideo",
        "preferProtocol":["iotc-av"]
    }
}

Nebula command response example for iotc-av:

{
    "statusCode": 200,
    "statusMsg": "OK",
    "content":{
        "url":"iotc-av://*/0/audio"
    }
}

Nebula command request example webrtc:

{
  "func": "startLiveStream",
  "args": {
    "channel": 1,
    "preferProtocol": ["webrtc"]
  }
}

Nebula command response example for webrtc:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content": {
    "url": "webrtc://*/video"
  }
}

getPlaybackCapabilities

Description:
Version: 1.1
Function set: playback
Request parameters: Empty
Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
protocolString arrayM
streamTypeString arrayM
channelsInt arrayO
Enumeration of protocol
webrtc
rtsp-iotc-tunnel
hls-iotc-tunnel
iotc-av
Enumeration of streamType
video
audio
subVideo
audioAndVideo
audioAndSubVideo

Device profile example:

{
    "func":"getPlaybackCapabilities",
    "return":{
        "protocol":["String"],
        "streamType":["String"],
        "channels":["Int"]
    }
}

Nebula command request example:

{
    "func":"getPlaybackCapabilities"
}

Nebula command response example:

{
    "statusCode": 200,
    "statusMsg": "OK",
    "content":{
        "protocol":["rtsp-iotc-tunnel","iotc-av", "webrtc"],
        "streamType":["video","audio","audioAndVideo", "subVideo"],
        "channels":[0,1,5]
    }
}

startPlayback

Description:
Version: 1.1
Function set: playback
Request parameters:

Parameter nameData typeRequirementDescription
streamTypeStringM
preferProtocolString ArrayM
channelIntO
fileNameStringOPlease choose one from fileName or startTime, fileName for the events, startTime for the contiuous recording
startTimeIntOtimestamp
endTimeIntOtimestamp, some platforms do not need this parameter when the duration is fixed, support in version 1.2

Please check getPlaybackCapabilities for the enumeration of preferProtocol and streamType

Response status code: 200, 400, 404(no event was found)
Response content:

Parameter nameData typeRequirementDescription
urlStringM
durationIntOunit: ms
iotc-channelIntOdefault value should be 0
protocolurl definition
rtsp-iotc-tunnelrtsp://iotc-tunnel:<remote port>/<rtsp path>
hls-iotc-tunnelhttp://iotc-tunnel:<remote port>/<hls m3us path>
iotc-aviotc-av://<UDID or *>/<iotc channel id>/<audio or video>
webrtcwebrtc://<UDID or *>/<stream id>
webrtc (when using TUTK agent)please fill in the URL with the original RTSP stream URL

Device profile example:

{
    "func":"startPlayback",
    "args":{
        "streamType":"String",
        "preferProtocol":["String"],
        "channel":"Int",
        "fileName":"String",
        "startTime":"Int"
    },
    "return":{
        "url":"String",
        "duration":"Int",
        "iotc-channel":"Int"
    }
}

Nebula command request example for rtsp:

{
    "func":"startPlayback",
    "args":{
        "channel":1,
        "streamType":"audioAndVideo",
        "preferProtocol":["rtsp-iotc-tunnel"],
        "fileName": "20190605_133000.mp4"
    }
}

or

// Sat, 15 June 2019 13:30:00 GMT
{
    "func":"startPlayback",
    "args":{
        "channel":1,
        "streamType":"audioAndVideo",
        "preferProtocol":["rtsp-iotc-tunnel"],
        "startTime": 1560605400
    }
}

Nebula command response example for rtsp:

{
    "statusCode": 200,
    "statusMsg": "OK",
    "content":{
        "url":"rtsp://iotc-tunnel:80/path/to/stream",
        "duration":10000
    }
}

setEventRecordingTriggers

Description:
Version: 1.0
Function set: playback
Request parameters:

Parameter nameData typeRequirementDescription
channelIntM
triggersString arrayO
Enumeration of trigger groups (sensor in getChannelsCapabilities)Enumeration of triggers (mode in getChannelsCapabilities)
motionmotionSensor, pir, perimeterIntrusion, lineCrossing
objectDetectionstationaryObject, human, vehicle, attributeDetection, animal, objectAbandoned, objectMissing
facialRecognition (faceRecognition)familiar, unfamiliar
faceDetectionface
counterscrossCounting, crowdDensity, queueLength
licensePlatelicensePlate
soundDetectionrareSound, sound, babyCry
otherinputTrigger, doorbellRing, lowBattery, videoTampering, automaticNetworkReplenishment, smokeAlarm, fireAlarm, heatmap, loiterDetection

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"setEventRecordingTriggers",
  "args":{
    "channel":"Int",
    "triggers":["String"]
  }
}

Nebula command request example:

{
  "func": "setEventRecordingTriggers",
  "args": {
    "channel": 1,
    "triggers": ["pir", "animal"]
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

getEventRecordingTriggers

Description:
Version: 1.0
Function set: playback
Request parameters:

Parameter nameData typeRequirementDescription
channelIntM

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
triggersString arrayM

Please check setEventRecordingTriggers for the enumeration of triggers.
Device profile example:

{
  "func":"getEventRecordingTriggers",
  "args":{
    "channel":"Int"
  },
  "return":{
    "triggers":["String"]
  }
}

Nebula command request example:

{
  "func":"getEventRecordingTriggers",
  "args":{
    "channel":1
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content": {
    "triggers": [
      "pir",
      "animal"
    ]
  }
}

enableAllLocalRecording

Description:
Version: 1.0
Function set: playback
Request parameters:

Parameter nameData typeRequirementDescription
valueBooleanM
channelIntOWhen this channel property is absent, all channel will be effected

Response status code: 200, 400
Response content: Empty
Please check setEventRecordingTriggers for the enumeration of triggers.
Device profile example:

{
  "func":"enableAllLocalRecording",
  "args":{
    "channel":"Int",
    "value":"Boolean"
  }
}

Nebula command request example:

{
  "func":"enableAllLocalRecording",
  "args":{
    "channel":1,
    "value":true
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

isAllLocalRecordingEnabled

Description:
Version: 1.0
Function set: playback
Request parameters:

Parameter nameData typeRequirementDescription
valueBooleanM
channelIntOWhen this channel property is absent, all channel will be effected

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"isAllLocalRecordingEnabled",
  "args":{
    "channel":"Int"
  },
  "return":{
    "value":"Boolean"
  }
}

Nebula command request example:

{
  "func":"isAllLocalRecordingEnabled",
  "args":{
    "channel":1
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "value":true
  }
}

setContinuousRecordingSchedule

Description:
Version: 1.0
Function set: playback
Request parameters:

Parameter nameData typeRequirementDescription
channelIntO
rulesrule object arrayM
elements of rule objectData typeRequirementDescription
weekdaysInt arrayM
startTimeStringMformat: HHMMSS
endTimeStringMformat: HHMMSS

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"setContinuousRecordingSchedule",
  "args":{
    "channel":"Int",
    "rules":[
      {
        "weekdays":["Int"],
        "startTime":"String",
        "endTime":"String"
      }
    ]
  }
}

Nebula command request example:

{
  "func": "setContinuousRecordingSchedule",
  "args": {
    "channel": 1,
    "rules": [
      {
        "weekdays": [1,2,7],
        "startTime": "110000",
        "endTime": "203000"
      }
    ]
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

getContinuousRecordingSchedule

Description:
Version: 1.0
Function set: playback
Request parameters:

Parameter nameData typeRequirementDescription
channelIntO

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
rulesrule object arrayM
elements of rule objectData typeRequirementDescription
weekdaysInt arrayM
startTimeStringMformat: HHMMSS
endTimeStringMformat: HHMMSS

Device profile example:

{
  "func":"getContinuousRecordingSchedule",
  "args":{
    "channel":1
  }
}

Nebula command request example:

{
  "func":"getContinuousRecordingSchedule",
  "args":{
    "channel":1
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "rules": [
      {
        "weekdays": [1,2,7],
        "startTime": "110000",
        "endTime": "203000"
      }
    ]
  }
}

enableContinuousScheduleRecording

Description:
Version: 1.1
Function set: playback
Request parameters:

Parameter nameData typeRequirementDescription
valueBooleanM
channelIntO

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"enableContinuousScheduleRecording",
  "args":{
    "channel":"Int",
    "value":"Boolean"
  }
}

Nebula command request example:

{
  "func":"enableContinuousScheduleRecording",
  "args":{
    "channel":1,
    "value":true
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

isContinuousScheduleRecordingEnabled

Description:
Version: 1.0
Function set: playback
Request parameters:

Parameter nameData typeRequirementDescription
channelIntO

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
valueBooleanM

Device profile example:

{
  "func":"isContinuousScheduleRecordingEnabled",
  "args":{
    "channel":"Int"
  },
  "return":{
    "value":"Boolean"
  }
}

Nebula command request example:

{
  "func":"isContinuousScheduleRecordingEnabled",
  "args":{
    "channel":1
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "value":true
  }
}

setPushNotificationTriggers

Description:
Version: 1.0
Function set: pushNotification
Request parameters:

Parameter nameData typeRequirementDescription
triggersString arrayM
channelIntO

Please check setEventRecordingTriggers for the enumeration of triggers.
Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"setPushNotificationTriggers",
  "args":{
    "channel":"Int",
    "triggers":["String"]
  }
}

Nebula command request example:

{
  "func":"setPushNotificationTriggers",
  "args":{
    "channel":1,
    "triggers":["pir"]
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

getPushNotificationTriggers

Description:
Version: 1.0
Function set: pushNotification
Request parameters:

Parameter nameData typeRequirementDescription
channelIntM

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
triggersString arrayM

Please check setEventRecordingTriggers for the enumeration of triggers.
Device profile example:

{
  "func":"getPushNotificationTriggers",
  "args":{
    "channel":"Int"
  },
  "return":{
    "triggers":["String"]
  }
}

Nebula command request example:

{
  "func":"getPushNotificationTriggers",
  "args":{
    "channel":1
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "triggers":["pir"]
  }
}

enablePushNotification

Description:
Version: 1.0
Function set: pushNotification
Request parameters:

Parameter nameData typeRequirementDescription
valueBooleanM
channelIntO

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"enablePushNotification",
  "args":{
    "channel":"Int",
    "value":"Boolean"
  }
}

Nebula command request example:

{
  "func":"enablePushNotification",
  "args":{
    "channel":1,
    "value":true
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

enablePushNotifications

Description:
Version: 1.1
Function set: pushNotification
Request parameters:

Parameter nameData typeRequirementDescription
channelschannel object arrayM
Elements of channel objectData typeRequirementDescription
valueBooleanM
channelIntM

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"enablePushNotifications",
  "args":{
    "channels":[
      {
        "channel":"Int",
        "value":"Boolean"
      }
    ]
  }
}

Nebula command request example:

{
  "func":"enablePushNotifications",
  "args":{
    "channels":[
      {
        "channel":1,
        "value":true
      },
      {
        "channel":2,
        "value":false
      },
      {
        "channel":3,
        "value":true
      },
      {
        "channel":4,
        "value":false
      }
    ]
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"
}

arePushNotificationsEnabled

Description:
Version: 1.1
Function set: pushNotification
Request parameters: Empty
Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
channelschannel object arrayM
Elements of channel objectData typeRequirementDescription
valueBooleanM
channelIntM

Device profile example:

{
  "func":"ArePushNotificationsEnabled",
  "return":{
    "channels":[
      {
        "channel":"Int",
        "value":"Boolean"
      }
    ]
  }
}

Nebula command request example:

{
  "func":"ArePushNotificationsEnabled"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "channels":[
      {
        "channel":1,
        "value":true
      },
      {
        "channel":2,
        "value":false
      },
      {
        "channel":3,
        "value":true
      },
      {
        "channel":4,
        "value":false
      }
    ]
  }
}

isPushNotificationEnabled

Description:
Version: 1.1
Function set: pushNotification
Request parameters:

Parameter nameData typeRequirementDescription
channelIntO

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
valueBooleanM

Device profile example:

{
  "func":"isPushNotificationEnabled",
  "args":{
    "channel":"Int"
  },
  "return":{
    "value":"Boolean"
  }
}

Nebula command request example:

{
  "func":"isPushNotificationEnabled",
  "args":{
    "channel":1
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "value":true
  }
}

getChannelInfo

Description:
Version: 1.1
Function set: channelInfo
Request parameters:

Parameter nameData typeRequirementDescription
channelIntM

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
statusStringM
nameStringO
firmwareVersionStringO
serialNumberStringO
modelStringO
macStringO
manufacturerStringO
typeStringO
ipStringO
storageTypeStringO
networkStringO
wifiSignalStrengthIntOpercantage
batteryLevelIntOpercantage
Enumation of statusdescription
unknowndisconnected or no camera
active
Inactiveconnected but in sleeping

Device profile example:

{
  "func":"getChannelInfo",
  "args":{
    "channel":"Int"
  },
  "return": {
    "status":"String",
    "name": "String",
    "firmwareVersion": "String",
    "serialNumber": "String",
    "model": "String",
    "mac": "String",
    "manufacturer": "String",
    "type": "String",
    "ip": "String",
    "storageType": "String",
    "network": "String",
    "wifiSignalStrength": "Int",
    "batteryLevel": "Int"
  }
}

Nebula command request example:

{
  "func":"getChannelInfo",
  "args":{
    "channel":"Int"
  }
}

Nebula command response example:
case 1

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content": {
    "status":"active",
    "name": "channel 1",
    "firmwareVersion": "20200608",
    "serialNumber": "CXQS1HJ72IOO",
    "model": "DB-WNIP2-SU",
    "mac": "54:2B:57:2E:84:50",
    "manufacturer": "NightOwl",
    "type": "doorbell",
    "ip": "192.168.4.36",
    "storageType": "none",
    "network": "asus router",
    "wifiSignalStrength": 88,
    "batteryLevel": 50
  }    
}

case 2

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content": {
    "status":"unknown"
  }    
}

setChannelName

Description:
Version: 1.1
Function set: channelInfo
Request parameters:

Parameter nameData typeRequirementDescription
channelIntM
nameStringM

Response status code: 200, 400
Response content: Empty
Device profile example:

{
  "func":"setChannelName",
  "args":{
    "name":"String",
    "channel":"Int"
  }
}

Nebula command request example:

{
  "func":"setChannelName",
  "args":{
    "name":"front door cam",
    "channel":1
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK"    
}

getChannelName

Description:
Version: 1.1
Function set: channelInfo
Request parameters:

Parameter nameData typeRequirementDescription
channelIntM

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
nameStringM

Device profile example:

{
  "func":"getChannelName",
  "args":{
    "channel":"Int"
  },
  "return":{
    "name":"String"
  }
}

Nebula command request example:

{
  "func":"getChannelName",
  "args":{
    "channel":1
  }
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "name":"front door cam"
  }
}

getChannelNames

Description:
Version: 1.1
Function set: channelInfo
Request parameters: Empty
Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
nameschannel object arrayM
Elelement of channel objectData typeRequirementDescription
nameStringM
channelIntM

Device profile example:

{
  "func":"getChannelNames",
  "return":{
    "names":[
      {
        "channel":"Int",
        "name": "String"
      }
    ]
  }
}

Nebula command request example:

{
  "func":"getChannelNames"
}

Nebula command response example:

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "names":[
      {
        "channel":1,
        "name": "front door cam"
      },
      {
        "channel":2,
        "name": "back door cam"
      }
    ]
  }
}

queryEventCalendar

Description:
Version: 1.1
Function set: playback
Request parameters:

Parameter nameData typeRequirementDescription
resolutionStringM
yearIntM
monthIntO
channelsInt arrayO
Enumeration of resolutionDescriptionNote
monthQuery which months have eventsThe parameter “month” should be ignored
dayQuery which days have eventsPlease fill in the “month” parameter

Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
resultsInt arrayM

Device profile example:

{
  "func":"queryEventCalendar",
  "args":{
    "resolution":"String",
    "year":"Int",
    "month":"Int",
    "channels":["Int"]
  },
  "return":{
    "results":["Int"]
  }
}

Nebula command request example:
case 1

{
  "func":"queryEventCalendar",
  "args":{
    "resolution":"month",
    "year":2020,
    "channels":[1]
  }
}

case 2

{
  "func":"queryEventCalendar",
  "args":{
    "resolution":"day",
    "year":2020,
    "month":10
    "channels":[1]
  }
}

Nebula command response example:
case 1

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "results":[2,10,12]
  }
}

case 2

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "results":[1,2,3,15,20,30]
  }
}

queryEventListByNumber

Description:
Version: 1.1
Function set: playback
Request parameters:

Parameter nameData typeRequirementDescription
listNumberIntM
startTimeIntMUNIX timestamp(unit: sec)
orderStringODefault value “descending”
eventTypesString arrayOsearch all event types if this parameter is not used or fill up with no element
channelsInt arrayO
Enumeration of orderDescription
descendingquery event in descending order from startTime to earliest event
ascendingquery event in ascending order from startTime to latest event

Please check setEventRecordingTriggers for the enumeration of triggers for eventTypes.
Response status code: 200, 400
Response content:

Parameter nameData typeRequirementDescription
resultsevent object arrayM
Elements of event objectData typeRequirementDescription
eventTypesString arrayM
timestampIntMUNIX timestamp(unit: sec) in timezone UTC+00:00
fileNameStringM
durationIntMthe duration of the event (unit: ms)
thumbnailUrlStringO
channelIntO
utcOffsetStringOIf the “utcOffset” field is not filled in, its default value should be “+0000". For UTC+08:00, it should be “+0800”.

Device profile example:

{
  "func": "queryEventListByNumber",
  "args": {
    "startTime":"Int",
    "order":"String",
    "listNumber":"Int",
    "eventTypes":["String"],
    "channels":["Int"]
  },
  "return":{
    "results":[
      {
        "eventTypes":["String"],
        "timestamp":"Int",
        "fileName":"String",
        "thumbnailUrl":"String",
        "channel":"Int",
        "duration":"Int"
      }
    ]
  }
}

Nebula command request example for descening order:
first step

// Mon, 01 Aug 2022 00:00:00 GMT+8
{
  "func": "queryEventListByNumber",
  "args": {
    "startTime": 1659283200,
    "order":"descending",
    "eventTypes": ["pir", "human"],
    "channels":[1,2],
    "listNumber":4
  }
}

next step
startTime = timestamp of the last item in the previous step -1

// Mon, 31 July 2022 23:59:39 GMT+8
{
  "func": "queryEventListByNumber",
  "args": {
    "startTime": 1659283179
    "order":"descending",
    "eventTypes": ["pir", "human"],
    "channels":[1,2],
    "listNumber":4
  }
}

Nebula command response example for descending order:
response of the first step

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "results":[
      {
        "eventTypes": ["pir"],
        "timestamp": 1659283200,
        "fileName": "20220801_000000_1.mp4",
        "thumbnailUrl": "http://iotc-tunnel:80/path/to/thumbnail1_1",
        "channel": 1,
        "duration": 10000
      },
      {
        "eventTypes": ["pir"],
        "timestamp": 1659283200,
        "fileName": "20220801_000000_2.mp4",
        "thumbnailUrl": "http://iotc-tunnel:80/path/to/thumbnail2_1",
        "channel": 2,
        "duration": 10000
      },
      {
        "eventTypes": ["pir"],
        "timestamp": 1659283180,
        "fileName": "20220731_235940_1.mp4",
        "thumbnailUrl": "http://iotc-tunnel:80/path/to/thumbnail1_3",
        "channel": 1,
        "duration": 10000
      },
      {
        "eventTypes": ["pir"],
        "timestamp": 1659283180,
        "fileName": "20220731_235940_2.mp4",
        "thumbnailUrl": "http://iotc-tunnel:80/path/to/thumbnail2_3",
        "channel": 2,
        "duration": 10000
      }
    ]
  }
}

response of the next step

{
  "statusCode": 200,
  "statusMsg": "OK",
  "content":{
    "results":[
      {
        "eventTypes": ["human","pir"],
        "timestamp": 1659283170,
        "fileName": "20220731_235930_1.mp4",
        "thumbnailUrl": "http://iotc-tunnel:80/path/to/thumbnail1_4",
        "channel": 1,
        "duration": 10000
      },
      {
        "eventTypes": ["pir"],
        "timestamp": 1659283170,
        "fileName": "20220731_235930_2.mp4",
        "thumbnailUrl": "http://iotc-tunnel:80/path/to/thumbnail2_4",
        "channel": 2,
        "duration": 10000
      },
      {
        "eventTypes": ["human","pir"],
        "timestamp": 1659283160,
        "fileName": "20220731_235920_1.mp4",
        "thumbnailUrl": "http://iotc-tunnel:80/path/to/thumbnail1_5",
        "channel": 1,
        "duration": 10000
      },
      {
        "eventTypes": ["pir"],
        "timestamp": 1659283160,
        "fileName": "20220731_235920_2.mp4",
        "thumbnailUrl": "http://iotc-tunnel:80/path/to/thumbnail2_5",
        "channel": 2,
        "duration": 10000
      }
    ]
  }
}


即刻开启您的物联网之旅

联系解决方案专家
Kalay App
资讯安全白皮书
全球专利布局
解决方案
新闻动态
公司动态
行业资讯
媒体报道
永续发展
经营者的话
社会参与
环境永续
公司治理

+86 755 27702549

7×24小时服务热线

法律声明 隐私权条款

关注“TUTK”

TUTK服务尽在掌握

© 2022 星空无限传媒xk8027版权所有粤ICP备14023641号
在线咨询
扫一扫

TUTK服务尽在掌握

全国免费服务热线
+86 755 27702549

返回顶部