Updated on 2023-02-16 GMT+08:00

Gateway Requesting for Deleting Child Devices

Function

This API is used by a gateway to deregister child devices on the platform.

Topic

Upstream: $oc/devices/{device_id}/sys/events/up

Parameters

Parameter

Mandatory or Optional

Type

Description

object_device_id

Optional

String

Identifies a gateway.

services

Optional

List<ServiceEvent>

Indicates a list of services that the event is about.

ServiceEvent structure

Parameter

Mandatory or Optional

Type

Description

service_id

Mandatory

String

System field. The value is fixed to $sub_device_manager.

event_type

Mandatory

String

System field. The value is fixed to delete_sub_device_request.

event_time

Optional

String

Indicates the time when the event occurs.

event_id

Optional

String

Uniquely identifies an event. If this parameter is not carried, an event ID will be generated by the platform. An event ID is a random string of 36 characters consisting of letters, numbers, and hyphens (-).

paras

Mandatory

Object

Indicates the event parameters in JSON format.

paras structure

Parameter

Mandatory or Optional

Type

Description

devices

Mandatory

List<String>

Identifies the child devices to delete. Up to 50 child devices can be deleted at a time.

Example

Topic: $oc/devices/{device_id}/sys/events/up 
Data format:
{
  "object_device_id": "{object_device_id}",
  "services": [
    {
      "service_id": "$sub_device_manager",
      "event_type": "delete_sub_device_request",
      "event_time": "20151212T121212Z",
      "event_id": "40cc9ab1-3579-488c-95c6-c18941c99eb4",
      "paras": {        
        "devices": [
          "c6b39067b0325db34663d3ef421a42f6_subdevice11",
          "c6b39067b0325db34663d3ef421a42f6_subdevice12"
        ]
      }
    }
  ]
}