【发布时间】:2017-11-23 22:27:16
【问题描述】:
我正在尝试在我的 nodejs 应用中获取公开个人资料的 10 张最新 Instagram 照片:
const request = require('request');
const accessToken = '1234567890123456789012345678901234567890';
const url = `https://api.instagram.com/v1/users/1470414259/media/recent/?access_token=${accessToken}&count=10`;
request.get(url, { json: true }, (err, res, body) => {
console.log('print the body: ', body);
});
我的尝试没有成功,我没有得到任何结果。 有人可以帮我搞定吗?
我正在尝试按照此处的示例进行操作:https://www.instagram.com/developer/endpoints/users/#get_users_media_recent
更新:
我将用户名更新为用户 ID,但我仍然没有得到响应:
{ meta:
{ code: 400,
error_type: 'APINotFoundError',
error_message: 'this user does not exist' } }
更新 2:
实际上我意识到我的访问令牌有一些限制:
{"meta": {"code": 400, "error_type": "OAuthPermissionsException", "error_message": "This request requires scope=public_content, but this access token is not authorized with this scope. The user must re-authorize your application with scope=public_content to be granted this permissions."}}
为什么会这样?我只是想获取一些公开的个人资料供稿。
更新 3:
有没有其他方法可以绕过这些访问令牌权限,只获取公共用户的 10 个媒体?
【问题讨论】:
标签: javascript node.js get instagram instagram-api