Facebook API - 没有过期的用户访问令牌

时间:2013-02-06 16:05:16

标签: facebook facebook-access-token

我读了here我可以在调用时为用户获取一个非过期的访问令牌:

https://graph.facebook.com/oauth/access_token?             
client_id=APP_ID&
client_secret=APP_SECRET&
grant_type=fb_exchange_token&
fb_exchange_token=EXISTING_ACCESS_TOKEN 

很明显client_idclient_secret是什么,但是grant_typefb_exchange_token到底是什么?

我设法将某些内容发布到用户的时间轴/针板上但是access_token我使用了APP_ID + | + APP_SECRET。它运作得很好。

BTW:我需要权限manage_pages,因为我想将照片添加到用户相册。

有什么想法,这两个属性是什么以及我可以从哪里得到它们?

1 个答案:

答案 0 :(得分:5)

grant type(第三个参数)只是字符串"fb_exchange_token"

fb_exchange_token(第四个参数)是之前已过期或即将过期的ACCESS_TOKEN

例如,您的请求网址应为:

https://graph.facebook.com/oauth/access_token
client_id=783921075894231403
&client_secret=78789230452234235412793042
&grant_type=fb_exchange_token
&fb_exchange_token=60as98dg690758a0sd5g57869608s9da8g6sda96g5s9adg
相关问题