V2.5 Get Command Jobs


Get command job details.

Request Format

GET https://{apigw-address}/connect-service/v2.5/commands?action=getJob

Request Parameters (URI)

Name

Location (Path/Query)

Mandatory/Optional

Data Type

Description

orgId

Query

Mandatory

String

The organization ID which the asset belongs to. How to get orgId>>

jobId

Query

Mandatory

String

Command job ID.

Response Parameters

Name

Data Type

Description

code

number

Failed or succeeded to create an alert. 0: succeeded, -1: failed.

msg

String

Returns OK if successful. Other returned values indicate failure.

requestId

String

A unique ID to identify a request.

data

Struct

See CommandInfo Struct.

CommandInfo Struct

Name

Data Type

Description

commandType

String

You can choose SERVICE_INVOKEMEASUREPOINT_SET

setMeasurepointInfo

Struct

The struct contains

  • measurepointId: String, asset measurement point. How to get pointId>>

  • value: String, Json, Integer, the value of the measurement point.

serviceInvokeInfo

Struct

The struct contains

  • serviceId: String, service ID.

  • inputData: String, contains the input parameters for the service call. The key is the parameter identifier, and the value type needs to conform to the definition in the ThingModel.

Samples

Request Sample

url: https://{apigw-address}/connect-service/v2.5/commands?action=getJob&jobId=jobId&orgId=yourOrgId
method: GET

Return Sample

{
    "code": 0,
    "msg": "OK",
    "requestId": "3029e3d8-a297-41cf-9fce-00ce39dfbfef",
    "data": {
        "orgId": "yourOrgId",
        "jobId": "jobId",
        "name": {
            "defaultValue": "commandJobName",
            "i18nValue": {
                "en_US": "name",
                "zh_CN": "中文名"
            }
        },
        "targetScope": {
            "targetType": "DEVICE_LIST",
            "targetDevices": [{
                "assetId": null,
                "productKey": "productKey",
                "deviceKey": "deviceKey"
            }]
        },
        "schedulePolicy": {
            "scheduleType": "DISPOSABLE",
            "disposableSchedulePolicy": {
                "triggerTs": 1718952446317
            }
        },
        "timeoutPolicy": {
            "inProgressTimeoutInSeconds": 30,
            "ttlTimeoutInSeconds": 20
        },
        "retryPolicy": {
            "enableRetry": true,
            "retryIntervalInSeconds": 300,
            "retryCount": 3
        },
        "desc": "commandJobDescription",
        "status": "ENABLED",
        "commandInfo": {
            "commandType": "SERVICE_INVOKE",
            "serviceInvokeInfo": {
                "serviceId": "serviceId",
                "inputData": {
                    "input": 22
                }
            },
            "measurepointSetInfo": null
        },
        "createTimestamp": 1718952422050
    }
}