如果我启用了我的应用程序的“2013年7月重大更改”迁移,那么通过电子邮件搜索用户将无效

时间:2013-04-29 07:49:08

标签: facebook access-token facebook-access-token facebook-graph-api

我正在使用搜索图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=...

July 2013 Breaking Changes工作正常之前。一旦我启用了重大更改,我就开始收到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=...

3 个答案:

答案 0 :(得分:1)

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

答案 1 :(得分:1)

您试试FQL吗?

  

SELECT uid,username,first_name,middle_name,pic,pic_small,pic_big,   pic_square,   姓氏,姓名,电子邮件,生日,birthday_date,CONTACT_EMAIL,CURRENT_ADDRESS,CURRENT_LOCATION,教育,hometown_location,   语言,语言环境,profile_url,性别,工作从用户在哪里   含有('youremail@example.com')

答案 2 :(得分: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

enter image description here

  

更新

     

最近,Graph API资源管理器应用已启用“2013年7月中断   改变“。所以我上面展示的例子不再适用了。