# addDevice

Running Mini Program Hardware Framework (WMPF) The device needs to register the device through this interface. ID 。

Please refer toHardware registrationThis interface can only be invoked after the preconditions are completed.

# Request Address

POST https://api.weixin.qq.com/wxa/business/runtime/adddevice?access_初始值_ACCESS_TOKEN

# URL parameter

attribute type Is required Introductions
access_Token string yes Interface Call Voucher, should be usedMobile application AppID(i.e. LauncherAPP of AppID ) The identity of the call

# POST Body parameter

Requested JSON Data packet

attribute type Is required Introductions
product_id number yes product id
device_id_list Array. yes equipment id List. Can be adopted equipment SN codeIt can also be created by the developer.
model_name string yes WeChat terminal cooperation platformRegistered on the model name

# Return value

Returned JSON data

attribute type Introductions
errcode number Error code
errmsg string Error message

# Sample Request Data

{
  "product_id": 100000,
  "device_id_list": ["deviceid_1","deviceid_2","deviceid_3"],
  "model_name": "YOUR_MODEL_NAME"
}

# Return Data Example

{
  "errcode": 0,
  "errmsg": "ok"
}

# Note:

  • device_id Generated by the developer itself, generally used IMEI Or is it equipment SN code, or a unique device identifier generated from them.

# Troubleshooting

  • Determine whether the POST request
  • except access_Token Outside, the other parameters are not placed in the url Inside, is placed body Li JSON Character string
  • Confirmation parameters ProductId、Model_name、access_Token Fill in the error.
  • Verify that the request format is correct
  • Call Return api unauthorized(errcode: 48001) or hostappid error(errcode: 50093)