-
Get a full REST API for Consuming GET Request , Specially defined for Engati flavored Schema
-
Useful for developers who need a quick back-end for prototyping and mocking
Create a engati.json
file
{
"data": {
"type": "carousel",
"templates": [{
"title": "20% Off",
"image_url": "https://viditgupta.me/botimage/footwear/woodlandlogo.png",
"buttons": [{
"payload": "https://viditgupta.me/botimage/footwear/woodlandmap.png",
"title": "View Location",
"type": "web_url"
}]
},
{
"title": "Free Installation with Bravia",
"image_url": "https://viditgupta.me/botimage/electronics/sonylogo.png",
"buttons": [{
"payload": "https://viditgupta.me/botimage/electronics/sonymap.png",
"title": "View Location",
"type": "web_url"
}]
}
]
}
}
$ npm start
Now if you go to http://localhost:3000/data, you'll get data similar to Following Schema
'use strict';
module.exports = function(Engati) {
let jsonData = {};
jsonData.data = {};
jsonData.data.type = "carousel";
jsonData.data.templates = [];
jsonData.data.templates.push({
"title": "title for",
"image_url": "hosted image",
});
console.log(jsonData);
};
GET /data
POST /data
PUT /data