如何通过API将Google Group添加至Google Chat Space?400报错求助
解决Google Chat API添加Google Group到Space时的400错误
你遇到的问题是请求参数格式不符合Google Chat API的要求,添加Google Group作为Space成员时,参数结构和标识格式都有误:
错误点分析
- 你使用了
groupMember字段,但API要求的字段是member - 群组的标识格式应该是
groups/[群组邮箱地址],而不是user/[邮箱](后者是单个用户的格式)
正确的请求示例
请求URL
POST https://chat.googleapis.com/v1/spaces/[space_ID]/members
请求体(JSON格式)
{ "member": { "name": "groups/[group_email_address]" } }
替换[space_ID]和[group_email_address]为实际值后重新调用,应该就能成功添加群组到指定Space了。
内容的提问来源于stack exchange,提问作者jeffpress
相关产品推荐
相关产品推荐

