Node.js Instagram订阅API获取响应hub.challenge
我正在读Instagram API文档 我理解必要的步骤 但是在这条线上Node.js Instagram订阅API获取响应hub.challenge,node.js,instagram-api,Node.js,Instagram Api,我正在读Instagram API文档 我理解必要的步骤 但是在这条线上 In order to verify the subscription, your server must respond to the GET request with the hub.challenge parameter only: Instagram向我的回调发送POST请求后,当他们声明服务器必须响应GET请求时,这是否意味着当他们调用我的GET回调时,我立即在GET回调中发送POST请求。在此post请求中
In order to verify the subscription, your server must
respond to the GET request with the hub.challenge parameter only:
Instagram向我的回调发送POST请求后,当他们声明服务器必须响应GET请求时,这是否意味着当他们调用我的GET回调时,我立即在GET回调中发送POST请求。在此post请求中,我将hub.challenge发送给
大概是
getInstagramSubscription(req,res){
//Grab hub.challenge and send post request to https://api.instagram.com/v1/subscriptions/
},
我试着用
但一旦我在heroku上部署了这个curl请求
curl -F 'client_id=client_id' \
-F 'client_secret=secret' \
-F 'object=username' \
-F 'aspect=media' \
-F 'verify_token=myVerifyToken' \
-F 'callback_url=callback_url/subscriptions' \
https://api.instagram.com/v1/subscriptions/
我仍然收到一个质询验证失败没关系,所以很明显你只是用hub.Challenge这样回应
getInstagramSubscription(req,res){
console.log(req.query)
//Just send back the hub.challenge
return res.send(req.query['hub.challenge']);
}
我在使用正确的回调url时也出现了一些错误
getInstagramSubscription(req,res){
console.log(req.query)
//Just send back the hub.challenge
return res.send(req.query['hub.challenge']);
}