【问题标题】:Get list of Spaces where the Google hangout chat bot is installed?获取安装了 Google 环聊聊天机器人的空间列表?
【发布时间】:2020-07-29 06:02:15
【问题描述】:

https://developers.google.com/hangouts/chat/reference/rest/v1/spaces/list

我正在使用它来获取安装机器人的所有空间的列表,但无法获得响应:

这里是代码sn-p。

credentials = ServiceAccountCredentials.from_json_keyfile_name(
    'service-account.json', scopes)
http = Http()
credentials.authorize(http)
chat = build('chat', 'v1', http=http) 
res = chat.spaces().list()
print res.body.   ----- this gives null 

我在这里遗漏了什么吗?

【问题讨论】:

  • 但是您定义了正确的范围,实现了from apiclient.discovery import build 并在管理控制台中为服务帐户提供了必要的范围?另外:您是您正在寻找的聊天室的成员吗?
  • 我遇到了同样的问题,知道如何让它工作吗?我可以发送到空间,但是当调用 list 方法时它返回空

标签: hangouts-chat


【解决方案1】:

对于仍然面临此问题的任何人,

使用res = chat.spaces().list().execute()
而不是res = chat.spaces().list()

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-15
    相关资源
    最近更新 更多