gpt4 book ai didi

hangout - 将 Webhook 发布到现有线程

转载 作者:行者123 更新时间:2023-12-04 02:52:35 24 4
gpt4 key购买 nike

试图弄清楚如何在 Hangouts Chat 中将 webhook 消息发布到聊天室中的现有线程。

当我发布到 webhook URL 时,我收到以下响应:

{
"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 响应中返回的“线程”发布到聊天室中的同一线程?

最佳答案

我想到了。您可以在返回的 JSON 中获取线程值。

在这种情况下,它是:

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

并将其添加到 JSON,然后发送下一个请求:
{ 
"cards": [
{
"header": {
"title": "Some Title",
"subtitle": "Some Subtitle",
"imageStyle": "IMAGE",
"imageUrl": "Some Image URL",
"imageAltText": ""
},
"sections": [],
"cardActions": [],
"name": ""
}
],
"thread": {
"name": "spaces/123123123123/messages/128391203812903809128"
}
}

关于hangout - 将 Webhook 发布到现有线程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54372950/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com