【发布时间】:2019-05-19 16:28:45
【问题描述】:
我发送了一个访问令牌,它在 Facebook 访问令牌调试器中是有效的,但它仍然说它不是活动的/是无效的访问令牌
我已尝试通过调试器放置访问令牌:出现为活动状态
var access_token = pathname.match(/\#(?:access_token)\=([\S\s]*?)\&/)[1];
$.ajax({
url: "https://graph.facebook.com/me?name?access_token=" + access_token,
type: 'GET',
success: function(response) {
console.log(response)
//Would want to do stuff with the Return data
},
error: function(response) {
$("#nameField").html("<li class='dataField' id='nameField'>The response could not locate the data source</li>")
}
});
我希望它返回 JSON 数据/单个 JSON 条目。最终显示:
{
"error": {
"message": "An active access token must be used to query information about the current user.",
"type": "OAuthException",
"code": 2500,
"fbtrace_id": "BdmIzcoyALS"
}
}
【问题讨论】:
标签: javascript jquery facebook-graph-api oauth-2.0