V2.1 Enable Device


Enable a device.


This API is available in EnOS 2.1.0 and above.

Operation Permissions


Before invoking this API, ensure that the service account has been authorized the policy that includes the following service(s) and action permission(s). For how to authorize the service account, see Managing Service Accounts.


Required Service Required Operation Permission
Device Management Service Full Access

Request Format

POST https://{apigw-address}/connect-service/v2.1/devices?action=enable

Request Parameters (URI)

Note

Use one of the following methods to specify the device to be enabled:

  • Include assetId in the request
  • Include productKey + deviceKey in the request
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>>
assetId Query Optional (See Note above) String The asset ID. How to get assetId>>
productKey Query Optional (See Note above) String The product key. To be used with deviceKey.
deviceKey Query Optional (See Note above) String The device key. To be used with productKey.

Error Codes

Code Message Description
11721
  • Device is inactive
  • Device is offline
  • Deivce is online
  • Device not found
  • The device is already enabled, and the device status is inactive.
  • The device is already enabled, and the device status is offline.
  • The device is already enabled, and the device status is online.
  • The assetId, productKey, and/or deviceKey used to specify the device does not exist.

Samples

Request Sample

url: https://{apigw-address}/connect-service/v2.1/devices?action=enable&orgId=yourOrgId&assetId=yourAssetId
method: POST

Return Sample

{
    "code": 0,
    "msg": "OK",
    "requestId": "06dd8ea3-cb9e-4628-8f93-d36c416bcd3a",
    "data": null
}

SDK Samples


You can access the SDK samples for Connection Service on GitHub: