Get Asset


Get asset data by asset ID.

If you need to invoke this API after performing bulk updates to relevant assets using other APIs, it is recommended to wait for about 2 seconds to avoid obtaining unupdated data.

Request Format

GET https://{apigw-address}/asset-service/v2.1/assets?action=get

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>>

assetId

Query

Mandatory

String

The asset ID. How to get assetId>>

Response Parameters

Name

Data Type

Description

data

Asset Struct

The details of the asset. For more information, see Asset Struct .

Asset Struct

Name

Data Type

Description

assetId

String

The asset ID.

orgId

String

The organization ID which the asset belongs to.

name

StringI18n

The asset’s name in its respective locale’s language. For more details on the structure and locales supported, see Internationalized name struct

description

String

The asset description.

attributes

Map

Attributes of the model which the asset belongs to. The Key is the attribute ID, which is of String type. The Value type depends on the attribute defined in the model.

timezone

String

The timezone where the asset is located.

modelId

String

The model ID.

modelIdPath

String

The model ID path. E.g.: /Turbine/Double_Feed_Turbine

tags

Map

User-defined tags. (The Key and Value are of String type.)

Error Codes

Refer to Public Response Codes.

Samples

Request Sample

url: https://{apigw-address}/asset-service/v2.1/assets?action=get&orgId=yourOrgId&assetId=yourAssetId
method: GET

Return Sample

{
  "msg": "OK",
  "code": 0,
  "data": {
    "modelId": "planet",
    "assetId": "yourAssetId",
    "timezone": "+00:00",
    "name": {
      "defaultValue":"venus!",
      "i18nValue": {
        "en_US": "English name ",
        "zh_CN": "Chinese name"
      }
    },
    "attributes": {
      "system": "Solar System"
    },
    "modelIdPath": "/planet",
    "orgId": "yourOrgId",
    "description": "description",
    "tags": {
      "tag1":"bright"
    }
  },
  "requestId": "9a5cfbac-b2f8-4a37-b38d-8bccdd77d073"
}

SDK Samples


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