我想读取用户的 apprequest-id。我已经完成了下面的功能:
获取服务器令牌:
url = "https://graph.facebook.com/oauth/access_token?client_id=#{app_id}&client_secret=#{secret_key}&grant_type=client_credentials"
然后,我构建了将 user_token 作为 {client_access_token} 发送到服务器的功能
所以,我调用这个函数来获取 AppRequest 作为 json
url = "https://graph.facebook.com/v2.3/#{fb_id}/apprequests/?input_token=#{client_access_token}&access_token=#{server_access_token}"
我得到了这个错误:
{
"error": {
"message": "(#15) Requires session when calling from a desktop app",
"type": "OAuthException",
"code": 15
}
}
起初,我认为 URL 调用或访问令牌有问题,但我已经用相同的 input_token 测试了另一个图形 api,例如 "/me/friends" 和 "/me/?fields=installed" 和访问令牌。而且,它可以正常工作。请帮忙。