将Webhook发布到现有线程

编程入门 行业动态 更新时间:2024-10-27 06:18:58
本文介绍了将Webhook发布到现有线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

试图弄清楚如何在环聊中将Webhook消息发布到聊天室中的现有线程.

Trying to figure out how to have a post a webhook message in Hangouts Chat to an existing thread in a chat room.

当我发布到Webhook URL时,得到以下响应:

When I post to the webhook URL, I get the following response:

{ "name": "spaces/123123123123/messages/128391203812903809128", "sender": { "name": "users/u4i3u4oi32u5oi23u4o23", "displayName": "Mecha", "avatarUrl": "", "email": "", "type": "BOT" }, "text": "", "cards": [ { "header": { "title": "Some Title", "subtitle": "Some Subtitle", "imageStyle": "IMAGE", "imageUrl": "Some Image URL", "imageAltText": "" }, "sections": [], "cardActions": [], "name": "" } ], "previewText": "", "annotations": [], "thread": { "name": "spaces/123123123123/messages/128391203812903809128" }, "space": { "name": "spaces/123123123123", "type": "ROOM", "displayName": "Chat Room" }, "fallbackText": "", "argumentText": "", "createTime": "2019-01-25T21:13:03.278543Z" }

是否可以使用JSON响应中返回的线程"将其发布到聊天室中的同一线程?

Is there a way to use the returned "thread" in the JSON response to post to the same thread in the chat room?

推荐答案

我知道了.您可以在返回的JSON中获取线程值.

I figured it out. You can take the thread value in returned JSON.

在这种情况下,是:

"thread": { "name": "spaces/123123123123/messages/128391203812903809128" },

并将其添加到JSON,然后发送下一个请求:

And add it to the JSON, you send in your next request:

{ "cards": [ { "header": { "title": "Some Title", "subtitle": "Some Subtitle", "imageStyle": "IMAGE", "imageUrl": "Some Image URL", "imageAltText": "" }, "sections": [], "cardActions": [], "name": "" } ], "thread": { "name": "spaces/123123123123/messages/128391203812903809128" } }

更多推荐

将Webhook发布到现有线程

本文发布于:2023-10-11 04:42:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1480711.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:线程   Webhook

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!