Я видел instagram-api-unable-to-reach-callback-url. Это не поможет. Я пытаюсь подписаться пользователюnodejs и instagram-node я получаю 400 - Не удается связаться с обратным адресом URL
Авторизоваться работает отлично, и это вызывает мой обратный вызов успешно (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!!');
}
});
};
но при попытке подписки вызова, я получаю
{ "код": 400, "ERROR_TYPE": "APISubscriptionError", "error_message": "Невозможно достичь обратного вызова 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 через мой браузер. Я также получил доступ к URL из https://www.site24x7.com/check-website-availability.html
Спасибо за любую помощь/предложения