tuya / tuya-android-industry-app-sdk-sample

This sample provides examples of Tuya Industry App SDK basic functions such as device network configuration, login and registration, and asset management of Tuya Open API.
MIT License
0 stars 0 forks source link

demo 正常运行,登录后,如何获取该账号授权的所有资产 #10

Closed Lelight-Iot closed 2 years ago

Lelight-Iot commented 2 years ago

点击demo的“资产列表”按钮,看到logcat报下错误

// 请求连接
https://openapi.tuyacn.com/v1.0/iot-03/users/assets?parent_asset_id=&page_no=0&page_size=10
// 回复
{"code":28841101,"msg":"No permissions. This API is not subscribed.","success":false,"t":1645788786051,"tid":"b32a6e56962e11ec8867ca79e2af5cda"}

文档中描述需要开通很多api服务,在目前云端平台已经没有了

请问现在需要哪些权限才能让sdk获取到第一层资产列表?

zlinoliver commented 2 years ago

你好 @Lelight-Iot , 您提供的logcat报错云端接口为:https://developer.tuya.com/cn/docs/cloud/5b11405e5e?id=Kajd42xz23vho

您需要订阅“行业项目客户端服务” API 才能获得相关权限, 详细配置可以参考:https://developer.tuya.com/cn/docs/app-development/iot-app-sdsk-core-preparation?id=Kaq9m1mhc5phr

Lelight-Iot commented 2 years ago

好的,添加对应api授权可以了