【发布时间】:2018-01-13 09:25:12
【问题描述】:
我花了一整天的时间试图找出这个错误,我还注意到有类似的问题与相同的消息,但我完全不确定我在那里找到答案,所以如果有人可以指出或给出任何提示我的问题,我非常感谢。
我正在请求通过测试 FB 应用名称 MyApp强>。我正在 Facebook Graph Explorer 上尝试这个。
我通过在 Facebook 页面中获取帖子中的 cmets 列表获得了用户 ID,但我完全无法发送消息。
这是错误
{
"error": {
"message": "(#100) No matching user found",
"type": "OAuthException",
"code": 100,
"error_subcode": 2018001,
"fbtrace_id": "H3yMO0RWaDy"
}
}
这是我的曲目
MyApp 已设置 webhook OK,因为它尚未发布用于测试目的(未批准的应用程序),所以我必须将用户 X 帐户添加到 MyApp 的测试器池中(我尝试发送的消息也是这个用户X)
我登录用户 X 对 FB Page A 中的帖子发表评论
-
在 Graph Explorer 上,我选择了 Application:MyApp,并获得 FB Page A 的页面访问令牌,我执行了以下两个请求
3.1/{page_id}_{post_id}?fields=comments
有了这个,我可以得到 FB Page A 中现有 cmets 的列表,输出如下:
{
"comments": {
"data": [
{
"created_time": "...",
"from": {
"name": "User X",
"id": "123456789" // this is the user Id that I would take to send the message to
},
"message": "Sample comment from User X",
"id": "..." // {page_id}_{post_id}
}
],
"paging": {
....
}
},
"id": "..." // {page_id}_{post_id
}
}
3.2 {page_id}/messages:我正在尝试使用从 3.1 步骤获得的用户 ID 从 FB 页面 A 向用户 X 发送消息
recipient: {id: "123456789"} // there seems be a problem with this id that I got from step 3.1, FB cannot find the user id with this number
message: {text: "hello"}
我也知道用户的应用程序/页面范围 ID。
我已经使用 API (/{page_id}/subscribed_apps) 将 MyApp 订阅到 FB Page A
Facebook API v2.10
我不知道出了什么问题。
【问题讨论】:
标签: facebook facebook-graph-api facebook-chatbot