Skip to content

Ayushverma8/Engati-API-Starter

Repository files navigation

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.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published