2015-06-20 116 views
0

我试图让我的应用程序的服务器端生日。获取用户生日HTTP请求

我已经对我的登录请求具有["user_birthday"]权限。

但现在在服务器上我需要做这样的事情,我猜。

userBirtdhay = "https://graph.facebook.com/me?fields=birthday&" + user.services.facebook.id; 

但这样的结果是类似的。

https://graph.facebook.com/me?fields=birthday&10146450841965723dffsadf 

如果你去到URL你得到一个

{ 
    "error": { 
     "message": "An active access token must be used to query information about the current user.", 
     "type": "OAuthException", 
     "code": 2500 
    } 
} 

经过一番研究得到了URL上的me空间应该是我的accessToken所以我尽量用。

https://graph.facebook.com/longAccesToken?fields=birthday& 

但它现在返回。

"message": "(#803) Some of the aliases you requested do not exist: 

回答

1

这将是正确的:

https://graph.facebook.com/me?fields=birthday&access_token=[your-user-token] 

你应该开始阅读有关的访问令牌和API端点Facebook的文档。您可以使用API Explorer来测试API。