facebook-graph-api - 找出谁在 Facebook 对话中写了一条消息

标签 facebook-graph-api

我正在我的应用程序中处理机器人,客户要求我在对话中自动检测机器人的消息。

当应用程序创建帖子时,我可以看到是谁写的帖子:me/posts?fields=admin_creator
但是当有人在对话中写了一条消息时,我如何才能在对话 API 中看到谁写了这条消息 me/conversations?fields=messages
编辑:
我需要知道谁通过我的页面回复消息。是我、机器人、应用程序或其他有权通过我的页面回答的人。

最佳答案

解决方案#1

通过阅读文档,我发现以下信息可以帮助您:

It's not possible to request a message by its individual message ID. Instead you should get the message as part of the thread it's a part of.



请注意 message对象有 fromto对象,所以

取自 Graph API Message docs .

解决方案#2

如果这对您没有帮助,我确定这两个帖子来自 chatbotsmagazine将要:
在关于Swell的帖子中应用程序,海报提出了一个问题:

How could you identify the user? We have existing users in our database who signed up with Facebook. There are two different user-ids though, according to Facebook’s Docs:

(..) Ids are page-scoped. These ids differ from those returned from Facebook Login apps which are app-scoped. You must use ids retrieved from a Messenger integration for this page in order to function properly.



然后,他们在这篇文章中提供了这个问题的答案:

FB Messenger Bot 🤖 — How to Identify a User via Page- & App-Scoped User-ID’s

我希望这有帮助。

关于facebook-graph-api - 找出谁在 Facebook 对话中写了一条消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49863788/

相关文章:

ios - React-native 应用程序和 Facebook SDK

facebook - 使用 facebook 图表搜索帖子 api 返回的时间

php - Facebook 60 天后更新用户 token

facebook - 如何使用 Facebook insights API 获取广告最终 url

javascript - Facebook 共享单页应用程序

facebook - 通过图形 API 的新闻提要与我在 facebook.com 上看到的非常不同

用于桌面应用程序的 Facebook 登录

javascript - Facebook 应用程序问题 - 无法获取权限,不断刷新

WordPress 根据 Facebook 评论显示热门帖子

iphone - iOS Facebook SDK,如何在App内登录,而不是在safari中登录