Queries information about a cloud gateway device.
Usage notes
The QueryVehicleDevice operation is suitable for scenarios in which you want to query information about a JT/T 808 or GB/T 32960 cloud gateway device.
QPS limits
You can call this API operation up to 50 times per second per account.
Debugging
Request parameters
Parameter |
Type |
Required |
Example |
Description |
Action | String | Yes | QueryVehicleDevice | The operation that you want to perform. Set the value to QueryVehicleDevice. |
IotInstanceId | String | Yes | iot-2w**** | The ID of the instance. You can view the ID of the instance on the Overview tab in the IoT Platform console. For more information, see Overview. |
ProductKey | String | Yes | a1Bw**** | The ProductKey of the product to which the device belongs. |
DeviceName | String | Yes | light | The name of the device. |
In addition to the preceding operation-specific request parameters, you must configure common request parameters when you call this operation. For more information about common request parameters, see Common parameters.
Response parameters
Parameter |
Type |
Example |
Description |
Code | String | iot.system.SystemException | The error code returned if the call fails. For more information, see the "Error codes" section of this topic. |
Data | Struct | The device information returned. |
|
CreateTime | Long | 1557062301656 | The timestamp when the device was created. Unit: milliseconds. |
DeviceName | String | light | The DeviceName of the device. |
IotId | String | dm0001 | The ID of the device. The ID is a unique identifier that is issued by IoT Platform to the device. |
JtProtocolDeviceData | Struct | The device registration and verification information returned. This parameter is returned only if you use a JT/T 808 cloud gateway device. |
|
AuthCode | String | ******* | The verification code for the device. |
City | String | Hangzhou | The city where the device is registered. |
DeviceId | String | di0001 | The ID of the device. |
DeviceModel | String | dm0001 | The model of the device. |
Manufacturer | String | mf0001 | The ID of the device manufacturer. |
Province | String | Zhejiang | The province where the device is registered. |
RegisterTime | Long | 1517062301656 | The timestamp when the device was registered. Unit: milliseconds. |
Status | String | create | The status of the device. Valid values:
|
VehicleColour | String | 1 | The license plate color. The value must meet the requirements of the JT/T 808 protocol. For more information, see JT/T 808-2019. |
VehicleNumber | String | ZheA**** | The license plate number. |
ModifiedTime | Long | 1657062301656 | The timestamp when the device was last updated. Unit: milliseconds. |
ProductKey | String | a1BwAGV**** | The ProductKey of the product to which the device belongs. |
Protocol | String | gb32960 | The protocol type of the cloud gateway. Valid values:
|
ErrorMessage | String | A system exception occurred. | The error message returned if the call fails. |
RequestId | String | E4C0FF92-2A86-41DB-92D3-73B60310D25E | The ID of the request. |
Success | Boolean | true | Indicates whether the call was successful. Valid values:
|
Examples
Sample requests
http(s)://iot.cn-shanghai.aliyuncs.com/?Action=QueryVehicleDevice
&ProductKey=a1Bw****
&DeviceName=light
&IotInstanceId=iot-cv3********
&<Common request parameters>
Sample success responses
XML
format
<QueryVehicleDeviceResponse>
<RequestId>CF291A12-EBB7-5A38-A087-C8A04450913E</RequestId>
<Data>
<IotId>ERfsXh***************wk05dm0</IotId>
<ModifiedTime>1695274556000</ModifiedTime>
<CreateTime>1695274556000</CreateTime>
<Protocol>gb32960</Protocol>
<ProductKey>k05d******</ProductKey>
<DeviceName>Device01</DeviceName>
</Data>
<Success>true</Success>
</QueryVehicleDeviceResponse>
JSON
format
{
"RequestId": "CF291A12-EBB7-5A38-A087-C8A04450913E",
"Data": {
"IotId": "ERfsXh***************wk05dm0",
"ModifiedTime": 1695274556000,
"CreateTime": 1695274556000,
"Protocol": "gb32960",
"ProductKey": "k05d******",
"DeviceName": "Device01"
},
"Success": true
}
Error codes
HttpCode |
Error Code |
Error message |
Description |
400 | Iot.Device.NotExistedDevice | The device does not exist. | The device does not exist or is not activated. |
400 | iot.device.NullDeviceName | The ProductKey or DeviceName parameter cannot be empty. | The ProductKey or DeviceName parameter is empty. |
400 | iot.device.NoPermission | The Operation has not permission to the device. | You do not have permissions to manage the device. |
400 | Iot.Device.NoVehicleProtocolDevice | The data must be IoV device data. | The data does not belong to an Internet of vehicles (IoV) device. |
For a list of error codes, see Service error codes.