The URL couldn't be validated Facebook Messenger Chat Bot

Mirza Chilman

i tried to make some bot messenger on facebook, but when i try to setup the webhook it is always failed, any suggestion?

enter image description here

and here is my code, what did i do wrong in my setup?

const express   = require('express');
const bodyParser    = require('body-parser');
const request = require('request');
const app   = express();

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));

const APP_SECRET    = "";
const VALID_TOKEN   = "semarangbot";
const SERVER_URL    = "https://b915e9f8.ngrok.io";
const ACCESS_TOKEN  = "";
const server = app.listen(process.env.PORT || 5000, () => {
  console.log('Express server listening on port %d in %s mode', server.address().port, app.settings.env);
})
app.get('/', (req, res) => {
    console.log('Server Ok!');
    res.sendStatus(200);
});

app.get('/webhook', (req, res) => {
    if (req.query['hub.mode'] && req.query['hub.verify_token'] === VALID_TOKEN) {
        res.status(200).send(req.query['hub.challenge']);
    } else {
        res.status(403).end();
    }
});
amuramoto

You need to add /webhook to the URL in the 'Callback URL' field. That's the endpoint you have setup for verification. Right now, you are telling Messenger Platform to call / for verification which is only returning a 200OK.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

API authentication from a facebook messenger bot conversation

分類Dev

Facebook Messenger bot using Spring Boot?

分類Dev

Facebook messenger integration - bot does not provide the responses

分類Dev

How to use a database with a messenger chat bot to store responses of users?

分類Dev

Facebook Messenger notification sound doesn't work

分類Dev

Facebook Messenger Bot sharing structured message with postback button

分類Dev

Couldn't issue file extension for URL

分類Dev

Customer chat not working with React Messenger Customer Chat

分類Dev

“Get Started” button does not appear for FB Messenger bot on Messenger app

分類Dev

Facebook Messenger Botは、グループ内の2人以上の人とチャットできますか?

分類Dev

Facebook Messenger Bot、テストユーザー、誰かがこれを機能させましたか?

分類Dev

facebook-messenger-bot error: When & why this error raised "(#100) Length of param name_placeholder[text] must be less than or equal to 640"

分類Dev

Calling Facebook Messenger API in a synchronous fashion

分類Dev

No node for selector while using puppeteer on facebook messenger

分類Dev

I couldn't understand the getters

分類Dev

Switch Case, couldn't understand

分類Dev

SSH authenticity couldn't be established

分類Dev

couldn't find Object with id=

分類Dev

Is Facebook Chat integration possible with API 2?

分類Dev

facebook login : Can't Load URL: The domain of this URL isn't included in the app's domains

分類Dev

facebook login : Can't Load URL: The domain of this URL isn't included in the app's domains

分類Dev

mongo - couldn't connect to server 127.0.0.1:27017

分類Dev

NPM throws error "couldn't read dependencies"?

分類Dev

Couldn't resolve resource @color/colorAccent

分類Dev

Couldn't match expected type `[a]' with actual type `a'

分類Dev

Haskell couldn't match weird expected type

分類Dev

Python couldn't insert row to MySQL

分類Dev

Couldn't find HttpResponse or HttpServletResponse in Spring 4

分類Dev

Juniper Network Connect couldn't connect to server

Related 関連記事

  1. 1

    API authentication from a facebook messenger bot conversation

  2. 2

    Facebook Messenger bot using Spring Boot?

  3. 3

    Facebook messenger integration - bot does not provide the responses

  4. 4

    How to use a database with a messenger chat bot to store responses of users?

  5. 5

    Facebook Messenger notification sound doesn't work

  6. 6

    Facebook Messenger Bot sharing structured message with postback button

  7. 7

    Couldn't issue file extension for URL

  8. 8

    Customer chat not working with React Messenger Customer Chat

  9. 9

    “Get Started” button does not appear for FB Messenger bot on Messenger app

  10. 10

    Facebook Messenger Botは、グループ内の2人以上の人とチャットできますか?

  11. 11

    Facebook Messenger Bot、テストユーザー、誰かがこれを機能させましたか?

  12. 12

    facebook-messenger-bot error: When & why this error raised "(#100) Length of param name_placeholder[text] must be less than or equal to 640"

  13. 13

    Calling Facebook Messenger API in a synchronous fashion

  14. 14

    No node for selector while using puppeteer on facebook messenger

  15. 15

    I couldn't understand the getters

  16. 16

    Switch Case, couldn't understand

  17. 17

    SSH authenticity couldn't be established

  18. 18

    couldn't find Object with id=

  19. 19

    Is Facebook Chat integration possible with API 2?

  20. 20

    facebook login : Can't Load URL: The domain of this URL isn't included in the app's domains

  21. 21

    facebook login : Can't Load URL: The domain of this URL isn't included in the app's domains

  22. 22

    mongo - couldn't connect to server 127.0.0.1:27017

  23. 23

    NPM throws error "couldn't read dependencies"?

  24. 24

    Couldn't resolve resource @color/colorAccent

  25. 25

    Couldn't match expected type `[a]' with actual type `a'

  26. 26

    Haskell couldn't match weird expected type

  27. 27

    Python couldn't insert row to MySQL

  28. 28

    Couldn't find HttpResponse or HttpServletResponse in Spring 4

  29. 29

    Juniper Network Connect couldn't connect to server

ホットタグ

アーカイブ