Instagram 订阅 API 获得回复 hub.challenge

Instagram Subscription API get response hub.challenge

我正在阅读 Instagram API 文档 https://www.instagram.com/developer/subscriptions/

并且我了解必要的步骤

但是在这条线上

In order to verify the subscription, your server must 
respond to the GET request with the hub.challenge parameter only:

Instagram 向我的回调发送 POST 请求后,当他们声明 "server must respond to GET request" 是否意味着当他们调用我的 GET 回调时,我会立即在 GET 中发送 post 请求打回来。在这个 post 请求中,我将 hub.challenge 发送到“ https://api.instagram.com/v1/subscriptions/

类似

getInstagramSubscription(req,res){
     //Grab hub.challenge and send post request to https://api.instagram.com/v1/subscriptions/

},

我尝试使用 instagram-node-lib

 getInstagramSubscription(req,res){

     var handshake =  Instagram.subscriptions.handshake(req, res);

},

但是一旦我使用这个 curl 请求在 heroku 上部署

 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