Node.js APISubscriptionError instagram API专用网络
我正在尝试使用instagram node nodeJs API在本地主机上设置instagram订阅,但当我启动此代码时,出现以下错误:Node.js APISubscriptionError instagram API专用网络,node.js,instagram,instagram-api,Node.js,Instagram,Instagram Api,我正在尝试使用instagram node nodeJs API在本地主机上设置instagram订阅,但当我启动此代码时,出现以下错误: { [Error: APISubscriptionError: Invalid URL. The URL may be on a private network.] code: 400, error_type: 'APISubscriptionError', error_message: 'Invalid URL. The URL may be
{ [Error: APISubscriptionError: Invalid URL. The URL may be on a private network.]
code: 400,
error_type: 'APISubscriptionError',
error_message: 'Invalid URL. The URL may be on a private network.',
retry: [Function] } undefined
守则:
var express = require('express');
var app = express();
var api = require('instagram-node').instagram();
api.use({access_token : 'xxxxxxxxxxxxxxx'})
api.use({
client_id:'xxxxxxxxxx',
client_secret:'xxxxxxxxxxxxx'
});
var redirect_uri = 'http://127.0.0.1:3000/callback';
api.add_geography_subscription(48.565464564, 2.34656589, 100, 'http://127.0.0.1:3000/callback',
{},
function(err, result, remaining, limit){
console.log(err,result)
});
app.listen(3000);
有什么想法吗?Instagram或任何esle无法访问您的
localhost
或127.0.0.1
,因为您的计算机本身就知道并可以访问此IP地址。
您必须在公共IP地址或域上注册回调并在那里托管应用程序。我目前正在使用NodeJS和Instagram实时API构建一个应用程序。这个问题的答案是使用类似的方法。你也可以把你的应用程序放在类似的主机上
标记的答案仅部分正确。感谢您的回答,但请提供您的信息,Twitter可以做到这一点;)你有没有想过这件事?我也有同样的问题。在使用localtunnel时,您必须将什么设置为回调\u url和重定向\u uri?谢谢