1. API Description
api request domain name:
iot.cloud.tencent.com/api/exploreropen/tokenapi
This interface (AppTokenBindDeviceFamily) is used for user binding of Wi-Fi devices in mini programs or apps.2. Input Parameter
Name | Type | Required | Description |
Action | String | Yes | Common parameter, this interface takes values: AppTokenBindDeviceFamily. |
RequestId | String | Yes | Common parameter, unique request ID, can be generated manually, recommended to use uuid. Locating issues, need to provide the RequestId for the request. |
AccessToken | String | Yes | Common parameter, the Access Token obtained after users through WeChat ID, mobile phone or email account login successfully. |
Token | String | Yes | Distribution network Token. |
ProductId | String | Yes | Product ID. |
DeviceName | String | Yes | Device name. |
FamilyId | String | Yes | Family ID. |
RoomId | String | Yes | Room ID. |
3. Output Parameter
Name | Type | Description |
RequestId | String | Common parameter, unique request ID, can be generated manually, recommended to use uuid. Locating issues, need to provide the RequestId for the request. |
4. Example
User Binding Wi-Fi Device
Input Example
POST https://iot.cloud.tencent.com/api/exploreropen/tokenapi HTTP/1.1content-type: application/json{"Action": "AppTokenBindDeviceFamily","AccessToken":"tesetoken","Token": "bf******************d098","ProductId": "*******","DeviceName": "*******","FamilyId": "f************cc1","RoomId": "0""RequestId": "f92406b3-5a9a-4fe8-bc43-45e3d794bb68"}
Output example: successful
{"Response": {"Data": {"RequestId": "f92406b3-5a9a-4fe8-bc43-45e3d794bb68"}}}
Output example failure
{"Response": {"Error": {"Code": "InvalidParameterValue.InvalidAccessToken","Message": "Invalid Token"},"RequestId": "f92406b3-5a9a-4fe8-bc43-45e3d794bb68"}}
5. Error Code
Error Code | Description |
InvalidParameter | Invalid parameter. |
InvalidParameterValue | Invalid parameter value. |
InvalidParameterValue.TokenNotExist | The Token does not exist. |
InvalidParameterValue.TokenIsExpire | Token has expired. |
InvalidParameterValue.ReadTokenInfoError | Token read error. |
InvalidParameterValue.TokenNotBind | The Token is not bound, that is, the return status queried by the previous step API AppGetDeviceBindTokenState is in the initial status, not in the usable status. |
InvalidParameterValue.FamilyDeviceCountReadError | Error reading device quantity. |
UnauthorizedOperation | No operation permissions. |
UnauthorizedOperation.APPNoPermissionToStudioProduct | The App has no permission to perform operations on this product. |
UnauthorizedOperation.NoPermissionToFamily | No permission to operate this family. |
ResourceNotFound | Resource does not exist. |
ResourceNotFound.StudioFamilyNotExist | The family is not created or has been deleted. |
ResourceNotFound.StudioProductNotExist | The product is not created or has been deleted. |
ResourceNotFound.DeviceNotExist | The device is not created or has been deleted. |
LimitExceeded | Quantity Limit. |
LimitExceeded.FamilyDeviceExceedLimit | The device quantity exceeds the limit. |
InternalError | Internal error. |
InternalError.InternalServerException | Internal error. |
InternalError.InternalServerExceptionDB | Internal DB error. |
UnsupportedOperation | Unsupported operation. |
UnsupportedOperation.CannotBindSameFamily | The device has been bound. Do not repeat binding. |