Webhooks

Webhooks are a way to receive information on your custom service through simple HTTP posts. Webhooks are based on a "_We'll call you" _principle. Each time a webhook action is triggered, we'll call your webhook with a HTTP POST.

Getting started

Create a new webhook within the Code app.

Callback url

The URL your webhook is hosted

Verify token

This is a secret we send along with each and every call. It's important because you can use this to verify any call Flow.ai makes

Receiving calls

Whenever a webhook is triggered Flow.ai sends along data in JSON format.

{
    "type": "action",
    "verifyToken": "b34768df-4768-4768-8cfe-0ac99db46ca9",
    "threadId": "99eb45ed85a0a00cef41f55aa03bea17",
    "channelName": "socket",
    "query": "hi",
    "action": "onboarding",
    "intents": [],
    "params": {},
    "originator": {
        "actorId": "23249a99-a243-448b-asdf-daddd7bafb6c",
        "userId": "flowai|23249a99-1233-448b-ada1-daasafbafb6c",
        "name": "EN Bot",
        "role": "bot",
        "profile": {
            "description": "Flow.ai",
            "locale": "en",
            "picture": "https://flow.ai/img/brains/flowai.svg"
        }
    },
    "user": {
        "userId": "socket|172cda58-12ss-4cd3-b590-aadw8afad0c7|99ebefsw4455a45ed85a0a00ca03bea17",
        "role": "external",
        "name": "Gijs",
        "profile": {
            "fullName": "Gijs van de Nieuwegiessen",
            "picture": "https://en.gravatar.com/userimage/7047529/b39e32c5d5329bfafb378de8e4b25a3b.png"
        }
    },
    "replyUrl": "http://..."
}

Replying

Whenever you receive a webhook call Flow.ai expects a 200 response code from your server. With each reply you can send back messages and information.

{
    "verifyToken": "59a755e5-2581-4307-393f-630ad4983adf",
    "messages": [{
        "fallback": "Hi there",
        "responses": [{
            "type": "text",
            "payload": {
                "text": "Hi there"
            },
            "delay": 0
        }]
    }]
}

results matching ""

    No results matching ""