Include this HTTP header for each API request:
Authorization: Bearer ${ACCESS_TOKEN}
{ | |
"responses": [ | |
{ | |
"type": "text", | |
"elements": ["Ok, no problem"] | |
} | |
], | |
"parameters": { | |
"iname": "Darek" | |
} |
{ | |
"responses": [ | |
{ | |
"type": "text", | |
"elements": ["Hi, how are you", "Hello!"], | |
"filters": [] | |
}, | |
{ | |
"type": "cards", | |
"filters": [], |
{ | |
"parameters": { | |
"name": "John", | |
"email": "john@example.com" | |
} | |
} |
<html> | |
<head> | |
<title>Landing bot with BotEngine.ai</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"> | |
<style type="text/css"> | |
* { | |
font-family: 'Open Sans', sans-serif; | |
box-sizing: border-box; |
'use strict'; | |
const http = require('http'); | |
const url = require('url'); | |
const querystring = require('querystring'); | |
const token = 'secret'; // replace to process.env.TOKEN for non development | |
const server = http | |
.createServer((req, res) => { |
<!-- Start of BotEngine (www.botengine.ai) code --> | |
<script type="text/javascript"> | |
var default = "5a9e58267d596a0007028a15"; | |
var pages = { | |
"/home": "5a9e58267d596a0007028a25", | |
"/contact": "5a9e58267d596a0007028a25" | |
}; | |
window.__be = window.__be || {}; | |
window.__be.id = pages[window.location.pathname] || default; |
<!-- Start of BotEngine (www.botengine.ai) code --> | |
<script type="text/javascript"> | |
var disabledPages = [ | |
"/home" | |
] | |
if (disabledPages.indexOf(window.location.pathname) === -1) { | |
window.__be = window.__be || {}; | |
window.__be.id = "5a9e58267d596a0007028a15"; |
<!-- Start of BotEngine (www.botengine.ai) code --> | |
<script type="text/javascript"> | |
var enabledPages = [ | |
"/home" | |
] | |
if (enabledPages.indexOf(window.location.pathname) > -1) { | |
window.__be = window.__be || {}; | |
window.__be.id = "5a9e58267d596a0007028a15"; // here put your widget id | |
(function() { |