nodejs 和 instagram-node 我收到 400 - 无法到达回调 URL
nodejs and instagram-node i am getting a 400 - Unable to reach callback URL
我看过instagram-api-unable-to-reach-callback-url。
这没有帮助。
我正在尝试订阅一个用户
Authorize 工作正常,它成功调用了我的回调
(redirect_uri = http://home.mydomain.me:8889/handleauth) 我得到一个 result.access_token
exports.handleauth = function(req, res) {
api.authorize_user(req.query.code, redirect_uri, function(err, result) {
if (err) {
console.log(err.body);
res.send("Didn't work");
} else {
console.log('Yay! Access token is ' + result.access_token);
res.send('You made it!!');
}
});
};
但是当我尝试拨打订阅电话时,我得到
{"code":400,"error_type":"APISubscriptionError","error_message":"Unable
to reach callback URL \"http://home.mydomain.me:8889/newpost\"."}
exports.subscribe2= function(req, res, next) {
var headers = {
'User-Agent': 'Super Agent/0.0.1',
'Content-Type': 'application/x-www-form-urlencoded'
}
var options = {
url: 'https://api.instagram.com/v1/subscriptions/',
method: 'POST',
headers: headers,
form: {'client_id': 'myclientid'
, 'client_secret': 'myclientsecret'
, 'object': 'user'
, 'aspect': 'media'
, 'verify_token': myAccessToken from result.access_token above
, 'callback_url': 'http://home.mydomain.me:8889/newpost'
}
};
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
// Print out the response body
console.log(body)
res.send(body);
} else{
console.log(error)
res.send(body);
}
})
};
我知道 URL 它可用。我可以去 http://home.mydomain.me:8889/newpost via my browser. I also accessed the URL from https://www.site24x7.com/check-website-availability.html
感谢任何帮助/建议
我完成这项工作的方法是让我的回调使用 https 而不是 http
我看过instagram-api-unable-to-reach-callback-url。 这没有帮助。 我正在尝试订阅一个用户
Authorize 工作正常,它成功调用了我的回调 (redirect_uri = http://home.mydomain.me:8889/handleauth) 我得到一个 result.access_token
exports.handleauth = function(req, res) {
api.authorize_user(req.query.code, redirect_uri, function(err, result) {
if (err) {
console.log(err.body);
res.send("Didn't work");
} else {
console.log('Yay! Access token is ' + result.access_token);
res.send('You made it!!');
}
});
};
但是当我尝试拨打订阅电话时,我得到
{"code":400,"error_type":"APISubscriptionError","error_message":"Unable to reach callback URL \"http://home.mydomain.me:8889/newpost\"."}
exports.subscribe2= function(req, res, next) {
var headers = {
'User-Agent': 'Super Agent/0.0.1',
'Content-Type': 'application/x-www-form-urlencoded'
}
var options = {
url: 'https://api.instagram.com/v1/subscriptions/',
method: 'POST',
headers: headers,
form: {'client_id': 'myclientid'
, 'client_secret': 'myclientsecret'
, 'object': 'user'
, 'aspect': 'media'
, 'verify_token': myAccessToken from result.access_token above
, 'callback_url': 'http://home.mydomain.me:8889/newpost'
}
};
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
// Print out the response body
console.log(body)
res.send(body);
} else{
console.log(error)
res.send(body);
}
})
};
我知道 URL 它可用。我可以去 http://home.mydomain.me:8889/newpost via my browser. I also accessed the URL from https://www.site24x7.com/check-website-availability.html
感谢任何帮助/建议
我完成这项工作的方法是让我的回调使用 https 而不是 http