Instagram已停止使用其旧的API,我正尝试在网站上显示另一个供稿。我无法通过Facebook上的测试人员帐户为开发人员创建新的访问令牌,但是此访问令牌的格式不同,因此无法在我的旧Feed上使用。
我的旧供稿正在使用https://api.instagram.com/v1
我这样称呼它:
var userFeed = new Instafeed({
get: 'user',
userId: '123123123',
limit: 12,
resolution: 'standard_resolution',
accessToken: '123123123.testtest.d9128u12u312oijd0',
sortBy: 'most-recent',
template: '<div class="gallery instaimg"><a href="{{image}}" title="{{caption}}" target="_blank"><img src="{{image}}" alt="{{caption}}" class="img-fluid"/></a></div>',
});
新的访问令牌更长,没有点。这是完全不同的格式。旧的看起来像这样 123123123.testtest.d9128u12u312oijd0
答案 0 :(得分:0)
https://api.instagram.com/oauth/authorize
?client_id={instagram-app-id}
&redirect_uri={redirect-uri}
&scope={scope}
&response_type=code
将程序设置为https://developers.facebook.com/
后,您需要像这样使用它将为您提供类似
的代码RSATsRW.c3rwde...
之后,您发布
https://api.instagram.com/oauth/access_token \
-F client_id=990602627938098 \
-F client_secret=eb8c7... \
-F grant_type=authorization_code \
-F redirect_uri=https://socialsizzle.herokuapp.com/auth/ \
-F code=RSATsRW.c3rwde...
它将为您提供令牌,用户名和ID