هذه الصفحة غير متوفرة حاليًا بلغتك المحلية. نحن نعمل جاهدين على إضافة المزيد من اللغات. شاكرين تفهمك ودعمك المستمر لنا.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Refreshing a Device Key

Updated on 2022-02-24 GMT+08:00

Typical Scenario

If the unique identification code of a device that has been registered with the IoT platform changes (for example, a device is replaced), an NA needs to call this API to update the unique identification code of the device and rebind the device.

NOTE:

The device password can be updated only when the device is offline.

API Function

This API is used by an NA to update the node ID of a device that has been registered with the IoT platform, and rebind the device with the device ID unchanged.

API Description

1
public function refreshDeviceKey($rdkInDTO, $deviceId, $appId, $accessToken)

Class

DeviceManagement

Parameter Description

Parameter

Mandatory or Optional

Location

Description

$rdkInDTO

Mandatory

body

For details, see RegDirectDeviceInDTO structure.

$deviceId

Mandatory

path

Identifies a device. The device ID is allocated by the IoT platform during device registration.

$appId

Mandatory

query

If the device belongs to the current application, set this parameter to null. Otherwise, set this parameter to the ID of the authorized application.

$accessToken

Mandatory

header

This parameter is set to the value of the access token obtained by calling the Authentication API.

RefreshDeviceKeyInDTO structure

Parameter

Mandatory or Optional

Location

Description

$verifyCode

Optional

body

Indicates the verification code of the device. If this parameter is specified in the request, it is returned in the response. If this parameter is not specified in the request, it is automatically generated by the IoT platform. You are advised to set this parameter to the value of nodeId.

$nodeId

Optional

body

Uniquely identifies the device. Generally, the MAC address, serial number, or IMEI is used as the node ID.

  • If the value is null, the value of this parameter remains unchanged.
  • If the value is not null, the value of this parameter is updated.
NOTE:

When the IMEI is used as the node ID, the node ID varies depending on the chip provided by the manufacturer.

  • The unique identifier of a Qualcomm chip is urn:imei:xxxx, where xxxx is the IMEI.
  • The unique identifier of a HiSilicon chip is the IMEI.
  • For details on the unique identifiers of chipsets provided by other manufacturers, contact the module manufacturers.

$timeout

Optional

body

Indicates the validity period of the verification code, in units of seconds. The value is an integer greater than or equal to 0.

  • If this parameter is set to null, the default value 180 prevails.
  • If this parameter is set to 0, the verification code never expires.
  • If this parameter is not set to 0, the verification code expires after the specified time elapses.

Return Value

RefreshDeviceKeyOutDTO structure

Parameter

Description

$verifyCode

Indicates a verification code that can be used by the device to obtain the device ID and password. If this parameter is specified in the request, it is returned in the response. If this parameter is not specified in the request, it is automatically generated by the IoT platform.

$timeout

Indicates the validity period of the verification code, in seconds. The device must connect to the IoT platform within this period.

Error Codes

HTTP Status Code

Error Code

Error Description

Remarks

200

100217

The application hasn't been authorized.

The application has not been authorized.

Recommended handling: In scenarios where applications are not authorized, ensure that request parameter appId is null.

400

100003

Invalid verify code.

The verification code is invalid.

Recommended handling: Check whether verifyCode carried in the API request is correct. If verifyCode is not carried in the API request, contact IoT platform maintenance personnel.

400

100007

Bad request message.

The request message contains invalid parameters.

Recommended handling: The value of deviceId is not assigned. Set this parameter based on the description of request parameters.

400

100426

The nodeId is duplicated.

The value of nodeId is duplicated.

Recommended handling: Check whether nodeId carried in the API request is correct.

400

100610

Device is not active.

The device has not been activated.

Recommended handling: Check whether the device has been connected to the IoT platform and activated.

400

100611

Device is online.

The device is online.

Recommended handling: Enable the device to go offline or disconnect the device from the IoT platform.

400

50400

The input is invalid.

An input parameter is invalid.

Recommended handling: Check whether parameters carried in the API call request are valid.

401

100025

AppId for auth not exist.

The application ID used for authentication does not exist.

Recommended handling:

  • Check whether the value is assigned to app_key in the header of the request structure.
  • If this API is called using HTTP, contact IoT platform maintenance personnel to check whether the name of appId in the header is app_key or x-app-key.

403

100203

The application is not existed.

The authorized application does not exist.

Recommended handling:

  • Check whether appId carried in the HTTP request header is correct.
  • Check whether appId in the request path (URL) is correct.

403

100217

The application hasn't been authorized.

The application has not been authorized.

Recommended handling: In scenarios where applications are not authorized, ensure that request parameter appId is null.

403

1010009

app throttle exceed.

The NA calls the API at a frequency that exceeds the flow control threshold (100 calls per minute by default).

Recommended handling: Contact IoT platform maintenance personnel to adjust the flow control threshold or control the API call frequency.

403

1010005

App_key or access_token is invalid.

The access token is invalid.

Recommended handling: Check whether accessToken carried in the API request is correct.

404

100403

The device is not existed.

The device does not exist.

Recommended handling: Check whether deviceId is correct.

404

100418

The deviceData is not existed.

The device data does not exist.

Recommended handling:

  • If deviceId carried in the request is incorrect, check whether deviceId belongs to appId or whether deviceId is incorrect.
  • Check whether appId carried in the header contains deviceId.
  • If the URL contains the optional parameter appId, check whether the value of appId is correct.

500

100203

The application is not existed.

The application does not exist.

Recommended handling:

  • Check whether appId carried in the HTTP request header is correct.
  • Check whether appId in the request path (URL) is correct.

500

50252

Internal server error.

An internal server error occurs.

Recommended handling: An internal error occurs on the IoT platform. Contact IoT platform maintenance personnel.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback