【发布时间】:2018-01-22 14:55:45
【问题描述】:
我正在像这样使用 instafeed.js:
var feed = new Instafeed({
get: 'user',
userId: 19191919191,
limit: 9,
accessToken: 'myaccesstokenhere',
target: 'instagram',
resolution: 'standard_resolution',
after: function() {
var el = document.getElementById('instagram');
if (el.classList)
el.classList.add('show');
else
el.className += ' ' + 'show';
}
});
但我收到此错误:
The access_token provided is invalid.
我通过https://www.instagram.com/developer 获得了access_token 我注册了我的应用程序并将客户端密码作为accessToken 并从这里https://smashballoon.com/instagram-feed/find-instagram-user-id/ 获得了我的用户ID
但它仍然在说The access_token provided is invalid.我做错了什么?
【问题讨论】:
-
来自文档:
Even though our access tokens do not specify an expiration time, your app should handle the case that either the user revokes access, or Instagram expires the token after some period of time. If the token is no longer valid, API responses will contain an “error_type=OAuthAccessTokenException”. In this case you will need to re-authenticate the user to obtain a new valid token. In other words: do not assume your access_token is valid forever.instagram.com/developer/authentication -
我做到了,我创建了一个全新的应用程序和令牌。
-
这里已经回答了,拍个look。
标签: javascript jquery instagram instagram-api instafeedjs