Ayushverma8 / Engati-API-Starter

NodeJS barebone API for Engati Chatbot Platfrom.

Home Page:https://goo.gl/6kH2Lr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maintainability

Introduction

  • 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

Example

Image of Code

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"
                }]
            }
        ]
    }
}

Start JSON Server

$ 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);
};

Plural routes

GET    /data 
POST   /data 
PUT    /data 

Official Docs

  • Engati for Updated Documemtation
  • Blog for the awesome Tutorials

About

NodeJS barebone API for Engati Chatbot Platfrom.

https://goo.gl/6kH2Lr

License:MIT License


Languages

Language:JavaScript 100.0%