问题描述
我正在使用搜索图 API 通过电子邮件搜索用户.这是我如何做到这一点的示例:
I'm using the search graph API to search for users by email. Here's an example of how I do that:
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,提示访问令牌无效.
Before the July 2013 Breaking Changes it was working fine. Once I enabled the breaking changes I start getting HTTP 403 saying that that the access token is not valid.
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 结果.问题是,这不是我要找的.我希望能够像以前一样通过电子邮件搜索用户.
Once I remove the %40 (@ sign) or the '.com' part from the request I get a normal HTTP 200 results. The problem is, that it's not what I'm looking for. I want to be able to search for users by email the way I was able before.
确实有效的请求示例:
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=...
推荐答案
正如林果皞所说.这是图形 API 中的一个错误.我在这里提交了一个错误:https://developers.facebook.com/bugs/335452696581712
As 林果皞 said. This is a bug in the graph API. I filed a bug here:https://developers.facebook.com/bugs/335452696581712
这篇关于如果我启用迁移“2013 年 7 月重大更改"我的应用程序,然后通过电子邮件搜索用户将不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!