Get Subscription Details


Get job details based on the subscription job ID.

Request Format


GET https://{apigw-address}/subscription-service/v1/subscription/{subId}

Request Parameters (URI)


Name

Location (Path/Query)

Required/Optional

Data Type

Description

subId

Path

Required

String

The subscription job ID.

orgId

Query

Required

String

The OU ID where the subscription job belongs to. How to get orgId >>

Response Parameters


Name

Data Type

Description

id

String

The system ID of the subscription job.

subId

String

The subscription job ID.

app

String

The access key of the application.

desc

StringI18n

International description of subscription jobs.

orgId

String

The OU ID.

type

Enum

Subscription type:

  • DATA: The subscription type is “Time Series Data Subscription”, and the message channel is “Real-Time”.

  • OFFLINE: The subscription type is “Time Series Data Subscription”, and the message channel is “Offline”.

  • EVENT: The subscription type is “Alert Data Subscription”, and the message channel is “Basic Alert Service”.

  • ALERT: The subscription type is “Alert Data Subscription”, and the message channel is “Advanced Alert Service”.

  • CASE: The subscription type is “Device Management Event Subscription”.

  • REPORT: The subscription type is “Device Event Report Subscription”.

content

Content Struct

The subscription job details. Content Struct >>

Content Struct


Name

Data Type

Description

customers

List<String>

The OU ID that has been authorized to subscribe to the job.

models

List<DeviceModel>

Model filtering conditions for the subscription job. DeviceModel Struct >>

useAllModels

Boolean

Whether this job have subscribed to all available models in the OU, true means yes, false means no.

assetIds

List<String>

If the organization structure filtering conditions are specified, assetIds indicates the site IDs selected on the organization structure. Only the “Time Series Data” type is supported.

structureRootId

String

Selected organization structure ID. Only the “Time Series Data Subscription” type is supported.

tags

Map<String, String>

The device tag filtering conditions for subscription jobs, structured {"key":"value"}. Only the following types are supported:

  • The subscription type is “Alert Data Subscription”, and the message channel is “Basic Alert Service”.

  • The subscription type is “Time Series Data Subscription”.

treeTags

Map<String, String>

The asset tree tag filtering condition for subscription jobs, structured {"key":"value"}. Only the “Alert Data Subscription” type with the message channel “Basic Alert Service” is supported.

eventTypes

List<String>

Device event type filtering conditions for subscription jobs, structure such as ["INFO","WARN"]. Only the “Device Event Report Subscription” type is supported.

sourceEventType

Map

Device event type filtering conditions for subscription jobs, structure such as {"MODEL": ["CREATE","DELETE","UPDATE"]}. Only the “Device Management Event Subscription” type is supported. The event types and their events are as follows:

  • MODEL: Represents the asset models, events include:

    • CREATE

    • DELETE

    • UPDATE

  • DEVICE_ASSET: Represents device assets, events include:

    • CREATE

    • ACTIVATE

    • ENABLE

    • DISABLE

    • DELETE

    • REPLACE_DEVICE_KEY

    • LOGIN

    • LOGOUT

    • CHANGE_INFO

    • ADD_SUBDEVICES

    • REMOVE_SUBDEVICES

    • REMOVE_ALL_SUBDEVICES

    • ADD_MIRROR_SOURCE

    • REMOVE_MIRROR_SOURCE

    • NOTIFY_COMMAND_STATE

  • LOGIC_ASSET: Represents logical assets, events include:

    • CREATE

    • DELETE

    • CHANGE_INFO

  • Foot_file: Represents the OTA firmware files, events include:

    • CREATED

    • DELETED

    • VERIFIED

  • Foot_job: Represents OTA jobs, events include:

    • CREATED

    • STARTED

    • STOPPED

    • UPDATED

    • STATISTICS_UPDATED

enabled

Boolean

Whether the subscription job has been started, true means it has been started, false means it has been suspended.

DeviceModel Struct


Name

Data Type

Description

models

String

Subscribed Model ID.

points

List<String>

Subscribed measurement point IDs, structure such as ["point1","point2"].

useAllPoints

Boolean

Whether to subscribe to all measurement points under the model, true means yes, false means no.

public

Boolean

Whether the model is a public model, true means yes, false means no.

Samples

Request Sample


url: https://{apigw-address}/subscription-service/v1/subscription/yourSubId?orgId=yourOrgId
method: GET

Response Sample


{
    "msg": null,
    "data": {
        "id": 61,
        "subId": "yourSubId",
        "app": "yourAppAccessKey",
        "desc": {
            "default": "Time Series Data - Online",
            "zh-CN": "时序数据-实时通道",
            "en-US": "Time Series Data - Online"
        },
        "orgId": "yourOrgId",
        "type": "DATA",
        "content": {
            "customers": [
                "CustomerOrgId"
            ],
            "models": [
                {
                    "modelId": "Demo1",
                    "useAllPoints": true,
                    "points": [
                        "lemo_point1_5min",
                        "merg_point_5min"
                    ],
                    "public": null
                }
            ],
            "useAllModels": false,
            "assetIds": [
                "assetId01",
                "assetId02"
            ],
            "structureRootId": "structureRootId",
            "tags": {
                "deviceTagKey": "deviceTagValue"
            },
            "treeTags": {

            },
            "eventTypes": [

            ],
            "sourceEventType": {

            }
        },
        "enabled": false
    },
    "subMsg": null,
    "requestId": null,
    "retCode": 0
}