如何与Ruby创建并发送Google聊天消息
在我的Rails应用程序中,我正在尝试使用API方法spaces.messages.messages.create
在此文档。为此,我将不得不使用服务帐户进行身份验证。我找不到有关如何使用Ruby参考Google聊天来执行此操作的示例。似乎我将不得不使用Ruby Cloud SDK,但我找不到对Google Chat 在这里。与其使用Google Cloud SDK,不如使用Ruby HTTP客户端执行此操作吗?
我想知道如何使用服务帐户进行身份验证并使用API方法spaces.messages.create
将消息发送到Google聊天
In my rails application, I am trying to create and send a google chat message using the api method spaces.messages.create
as explained in this documentation. To do that, I will have to authenticate with a service account. I cant find examples on how to do this with ruby in reference to google chat. It seems like I will have to use the ruby cloud sdk but I cant find any reference to google chat here . Instead of using the google cloud sdk, is it possible to do this with a ruby http client?
I will like to know how to authenticate using a service account and sending a message to google chat using the api method spaces.messages.create
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这些步骤如下:
https://www.googleapis.com/auth/chat.bot
范围。3-使用代码> 用于执行请求。
无论如何,我都强烈评论文档>用于Google Chats api 完全了解授权流程的工作原理。
更新的
样本Ruby客户端发送消息
I think the steps are as follows:
https://www.googleapis.com/auth/chat.bot
scope.googleauth
.3- Use the
google-apis-chat_v1
for performing the request.In any case, I strongly review the documentation for Google Chats API, for a full understanding on how the authorization flow works.
Updated
Sample ruby client send message