2012-08-23 108 views
-1

我可以从此链接获得访问令牌与一些点击:)获取Facebook的访问令牌无效

http://developers.facebook.com/tools/explorer

我retrived访问令牌很长,它

工作

graph.facebook.com/me/permissions?access_token

和其他图形API

但是当我获得访问令牌与此URL是很短的,而不是工作

https://graph.facebook.com/oauth/access_tokenclient_id=MYID&redirect_uri=http%3A%2F%2Fbenbiddington.wordpress.com&client_secret=MYSECID&grant_type=client_credentials&scope=read_stream,manage_friendlists,read_mailbox,read_page_mailboxes

它不工作,并返回

{ “错误”:{ “type”:“QueryParseException”, “message”:“必须使用活动访问令牌来查询信息mation关于当前用户。“ }}

但在某些情况下,它的工作

回答

0

这是一个VB.NET例子 - 但是我用这个获得获取访问令牌,为用户所有的时间,并且从来没有收到你的回应显示 - 所以这可能会有所帮助?

Public Class FacebookAuthorization 

    Private Shared Property BaseURL As String = "https://graph.facebook.com/oauth/authorize" 


    Public Shared Function GetAuthUrl(ByVal appID As String, ByVal redirectUrl As String, ByVal permissions As String) As String 

     Return String.Format("{0}?client_id={1}&redirect_uri={2}&type=user_agent&scope={3}", BaseURL, appID, redirectUrl, permissions) 

    End Function 

End Class 

编辑:

你从这个请求后面的的access_token可以使用像这样:

https://graph.facebook.com/me/feed?access_token=XXXXXX - 得到是你的墙/时间表

https://graph.facebook.com/me/home?access_token=XXXXXX - 得到是你自己的新闻源

+0

你可以在这个url中检索带有这个标记的信息吗? (4:30 PM)afshar:https://graph.facebook.com/SOME-ID/posts?method=GET&metadata=true&format=json&callback=___GraphExplorerAsyncCallback___&access_token= ??? – user1514512

+0

请参阅编辑信息。 – wakurth