✅已解决 | success = management_client.users.kick([user_id]) 失败

其中:user_id 是登录用户的 userid。

success = management_client.users.kick([user_id])

返回错误如下。请问这个参数怎么传递才是对的:

KeyError

KeyError: ‘data’

Traceback (most recent call last)

  • File “C:\Users\hao\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py”, line 2464, in __call__

return self.wsgi_app(environ, start_response)

  • File “C:\Users\hao\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py”, line 2450, in wsgi_app

response = self.handle_exception(e)

  • File “C:\Users\hao\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py”, line 1867, in handle_exception

reraise(exc_type, exc_value, tb)

  • File “C:\Users\hao\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask_compat.py”, line 39, in reraise

raise value

  • File “C:\Users\hao\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py”, line 2447, in wsgi_app

response = self.full_dispatch_request()

  • File “C:\Users\hao\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py”, line 1952, in full_dispatch_request

rv = self.handle_user_exception(e)

  • File “C:\Users\hao\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py”, line 1821, in handle_user_exception

reraise(exc_type, exc_value, tb)

  • File “C:\Users\hao\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask_compat.py”, line 39, in reraise

raise value

  • File “C:\Users\hao\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py”, line 1950, in full_dispatch_request

rv = self.dispatch_request()

  • File “C:\Users\hao\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py”, line 1936, in dispatch_request

return self.view_functionsrule.endpoint

  • File “H:\data\My Documents\GitHub\speech-assist\application.py”, line 473, in index

return processusersession(request, 1)

  • File “H:\data\My Documents\GitHub\speech-assist\application.py”, line 347, in processusersession

success = management_client.users.kick([user_id])

  • File “C:\Users\hao\AppData\Local\Programs\Python\Python38\Lib\site-packages\authing\v2\management\users.py”, line 730, in kick

return self.restClient.request(

KeyError: ‘data’

稍等我看一下 ~~~~~

我们调用成功了,用户也成功下线了,Python SDK 解析返回结果的逻辑有问题,稍等我们修复一下 Python SDK

已修复,您更新一下最新版的 SDK: 4.5.6 哈

就是说重新来一次 pip install 吗?

补充:对了。更新到 4.5.6后可以了。谢谢!

不用谢 有问题及时向我们反馈哈