Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js Instagram订阅API获取响应hub.challenge_Node.js_Instagram Api - Fatal编程技术网

Node.js Instagram订阅API获取响应hub.challenge

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请求中

我正在读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请求中,我将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']);
}