4

我正在使用搜索图 API 通过电子邮件搜索用户。这是我如何做到这一点的一个例子:

GET  https://graph.facebook.com/search?q=Sample%40gmail.com&fields=name%2clink%2ceducation%2cid%2cwork%2cabout%2cpicture&limit=2&type=user&access_token=...

2013 年 7 月的重大更改之前,它运行良好。启用重大更改后,我开始收到 HTTP 403 提示访问令牌无效。

HTTP/1.1 403 Forbidden
Access-Control-Allow-Origin: *
Cache-Control: no-store
Content-Type: text/javascript; charset=UTF-8
Expires: Sat, 01 Jan 2000 00:00:00 GMT
Pragma: no-cache
WWW-Authenticate: OAuth "Facebook Platform" "insufficient_scope" "(#200) Must have a valid access_token to access this endpoint"
X-FB-Rev: 798183
X-FB-Debug: lZPVbdTmZrCo+Bde/MNEXy/halUzQx7qIDW5aiZeT0g=
Date: Mon, 29 Apr 2013 07:25:29 GMT
Connection: keep-alive
Content-Length: 120

{"error":{"message":"(#200) Must have a valid access_token to access this endpoint","type":"OAuthException","code":200}}

从请求中删除 %40(@ 符号)或 '.com' 部分后,我会得到正常的 HTTP 200 结果。问题是,这不是我要找的。我希望能够像以前那样通过电子邮件搜索用户。

有效的请求示例:

GET  https://graph.facebook.com/search?q=Samplegmail.com&fields=name%2clink%2ceducation%2cid%2cwork%2cabout%2cpicture&limit=2&type=user&access_token=...
GET  https://graph.facebook.com/search?q=Sample%40gmail&fields=name%2clink%2ceducation%2cid%2cwork%2cabout%2cpicture&limit=2&type=user&access_token=...
4

3 回答 3

1

正如林果皞所说。这是图形 API 中的一个错误。我在这里提交了一个错误: https ://developers.facebook.com/bugs/335452696581712

于 2013-04-29T11:17:01.587 回答
1

你试过FQL吗?

选择 uid,username,first_name,middle_name,pic,pic_small,pic_big,pic_square,last_name,name,email,birthday,birthday_date,contact_email,current_address,current_location,education,hometown_location,languages,locale,profile_url,sex,work FROM user where contains ('yourmail@example.com')

于 2013-07-09T08:22:48.890 回答
0

通过电子邮件搜索对我来说很好(访问令牌只是授予了足够的基本权限):

https://developers.facebook.com/tools/explorer?method=GET&path=%2Fsearch%3Fq%3Dlimkokhole%40gmail.com%26fields%3Dname%2Clink%2Ceducation%2Cid%2Cwork%2Cabout%2Cpicture%26limit%3D2%26type %3Duser

在此处输入图像描述

更新

最近 Graph API 浏览器应用程序已经启用了“2013 年 7 月的重大更改”。所以我上面展示的例子不再适用了。

于 2013-04-29T09:17:24.667 回答