gpt4 book ai didi

Facebook Messenger API : Send Structured Message

转载 作者:行者123 更新时间:2023-12-02 22:12:22 26 4
gpt4 key购买 nike

当关注this example时.

messageData = {
"attachment": {
"type": "template",
"payload": {
"template_type": "generic",
"elements": [{
"title": "First card",
"subtitle": "Element #1 of an hscroll",
"image_url": "http://messengerdemo.parseapp.com/img/rift.png",
"buttons": [{
"type": "web_url",
"url": "https://www.messenger.com/",
"title": "Web url"
}, {
"type": "postback",
"title": "Postback",
"payload": "Payload for first element in a generic bubble",
}],
},{
"title": "Second card",
"subtitle": "Element #2 of an hscroll",
"image_url": "http://messengerdemo.parseapp.com/img/gearvr.png",
"buttons": [{
"type": "postback",
"title": "Postback",
"payload": "Payload for second element in a generic bubble",
}],
}]
}
}

我收到错误:

\"error\":{\"message\":\"(#100) Incomplete element data: title and at least one other field (image url, subtitle or buttons) is required with non-empty value\",\"type\":\"OAuthException\",\"code\":100,\"fbtrace_id\":\"ElbXaF25+0G\"}

我错过了什么吗?在我看来,所有相关字段都存在。

最佳答案

弄清楚了,用 ruby​​ 编写这个,我需要在发送之前对哈希调用 to_json

关于Facebook Messenger API : Send Structured Message,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36634453/

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