Instagram access token

纵然是瞬间 提交于 2019-12-10 11:58:38

问题


I need to display intsagram photo by one user in my webpage. So, users that watch the page don't need any "login" mask, just look at the photos by the user (which is the owner of the current webpage).

So, in my further application I can call:

https://api.instagram.com/v1/users/" + userID + "/media/recent?client_id=" + id + "&access_token=2822asfa656.24523525.934634634csafa8asasaeea40

But Instagram API says Access tokens may expire at any time in the future..

So how can I manage this scenario? I won't to change access_token every time, in the future!


回答1:


Had same issue. The best and most reliable solution imo:

  1. fetch json from 'http://instagram.com/{user_name}/media'
  2. ... your_code (templating etc) ...
  3. cache the result
  4. profit :D



回答2:


I think the general approach for Access_Tokens is that they are issued to each Authenticated user and shouldn't be shared amongst multiple users given their volatility to expire. Client_ID is your global access token but obviously has limitations of 5000 requests per hour, so in my implementations of the Instagram API i store the Access_Token against the user session on my site so every user has their own unique Access_Token once they authenticate, otherwise they will use the Client_ID.



来源:https://stackoverflow.com/questions/14461791/instagram-access-token

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!