What is a Webhook Response?

A webhook response is a piece of code, you can send via a webhook to create a message within the Bot Platform. Every one of the tutorials on this site uses at least one type of webhook response.

You can use a webhook response in any middleware platform.

When we use a webhook within a bot, information is passed from The Bot Platform, to the webhook, which can then be interpreted using a middleware platform and a response returned.

What Information is passed from The Bot Platform?

Here is an example of the information passed from to a webhook from The Bot Platform:

395
{
        "version": "1.0",
        "timestamp": 1607034750567,
        "item": {},
        "fbuser": {
            "fbid": "FBID_no",
            "first_name": "Robert",
            "last_name": "Jackson",
            "profile_pic": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=458173168105351&height=50&width=50&ext=1609626738&hash=AeQmecOAELwNLTnIGQs",
            "locale": "en_GB",
            "timezone": null,
            "gender": null,
            "message_count": 21,
            "last_message": 1607034744163,
            "last_user_interaction": "1607034738581",
            "opted_in": "0",
            "gdpr_consent_opted_in": "1",
            "state": {
                "messages": {},
                "vars": {
                    "$Integrationsearch": "Hootsuite",
                    "$$tutorialsearch": "Review submitting"
                },
                "expect": {
                    "variable_name": "$Integrationsearch",
                    "response_id": "@BP:MESSAGE:100243",
                    "filters": {}
                }
            },
            "department": "Sales",
            "title": "Director of Business Development",
            "email": "[email protected]",
            "external_id": "102057372305799",
            "link": "https://tbp.facebook.com/app_scoped_user_id/YXNpZADpBWEhhcUE2MFJfSkt4ZA2s4MHpvTlM3eWoyT2s1Ykpha2o3aW1Dd21PTkdrUEZA2XzRCc3FBNzduZAXZAab0tFSzNkTnVYWGtIWl9RMDZAWVGl6em9xX3ZArM0g0ZAWNXbTdjN1BxUHFiX2lkQjBQWS1ERm53/"
        }
    }