내 페이스 북 대시 보드에서 메신저 설정 방법에 관해 정말로 혼란 스럽다. 나는 페이스 북의 API와 통신 할 수 Heroku가에 Node.js를 응용 프로그램을-설정하고 다음 콜백 URL에 연결을 시도했다 :heroku 콜백 URL을 Facebook 대시 보드에 추가하는 방법은 무엇입니까?
The URL couldn't be validated. Callback verification failed with the following errors: HTTP Status Code = 403; HTTP Message = Forbidden
:
https://ancient-dawn-XXXXX.herokuapp.com/webhook/
그러나 나는 다음과 같은 오류를 얻고있다
내 애플의 app.js 파일에 다음 코드를 포함
var express = require("express");
var request = require("request");
var bodyParser = require("body-parser");
var app = express();
app.use(bodyParser.urlencoded({extended: false}));
app.use(bodyParser.json());
app.listen((process.env.PORT || 5000));
// Server index page
app.get("/", function (req, res) {
res.send("Deployed!");
});
// Facebook Webhook
// Used for verification
app.get("/webhook/", function (req, res) {
if (req.query["hub.verify_token"] === "process.env.VERIFICATION_TOKEN") {
console.log("Verified webhook");
res.status(200).send(req.query["hub.challenge"]);
} else {
console.error("Verification failed. The tokens do not match.");
res.sendStatus(403);
}
});
내가하려고 URL에 액세스 https://murmuring-temple-XXXXX.herokuapp.com/webhook/
나는 또한 포비 던 응답을 받는다.
무엇이 누락 되었습니까?
앱이 작동합니까? 당신이 루트에 갈 때, 당신은 "Deployed!" 메시지. –