GithubHelp home page GithubHelp logo

chatfuel-json / chatfuel-json-api-examples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ttypic/chatfuel-json-api-examples

0.0 0.0 0.0 475 KB

Examples of lambda functions for Chatfuel JSON API

License: MIT License

TypeScript 99.69% JavaScript 0.31%

chatfuel-json-api-examples's Introduction

Chatfuel JSON API examples

netlify-deploy

Installation

Click Deploy to Netlify button, or:

  1. Fork this repository
  2. Sign up to netlify.com
  3. Choose New site from git option and follow the instructions

Usage

Business hours

Bot admin enters their business hours; an attribute is set for 'open' or 'closed' based on the current time

Your JSON API is POST https://{your-netlify-app-name}.netlify.app/api/functions/business-hours

Parameters

  • tz - time zone, either number in hours or name see
  • Monday..Sunday - day working hour in format h:mmAM-h:mmPM

Attributes

This JSON API setups those attributes to bot user:

  • business - open if current time inside working hours, closed otherwise

Shopify check customer

Look up an email address in the Shopify store to check if that user has placed an order before or not

Your JSON API is POST https://{your-netlify-app-name}.netlify.app/api/functions/shopify-check-customer-v2

Parameters

  • email - user email
  • store_url - Shopify store url
  • password - Shopify store password

Attributes

This JSON API setups those attributes to bot user:

  • customer - existing if email found in shop orders, new otherwise

Shopify create discount

Create a unique discount code in Shopify using different parameters like % off or % off, days until expiration, one-time use or not, etc.

Your JSON API is POST https://{your-netlify-app-name}.netlify.app/api/functions/shopify-discount

Parameters

  • store_url - Shopify store url
  • password - Shopify store password
  • timezone - user timezone
  • expiration - days until expiration
  • discount_value - amount of discount
  • discount_type - percentage or amount
  • one_use_per_customer - if true then only one customer can use it
  • times_code_can_be_used - number of times discount can be used

Attributes

This JSON API setups those attributes to bot user:

  • discount_code - allocated code,
  • expiration_date - discount code expiration date

Verify email

Check if the input a user has entered is an email or not (checks to see if domain exists, not just that it uses an '@' symbol and '.') - also fixes validation loop with built-in email validation

Your JSON API is GET https://{your-netlify-app-name}.netlify.app/api/functions/verify-email

Parameters

  • email - email

Attributes

This JSON API setups those attributes to bot user:

  • emailValid - true if email is valid, false otherwise

Verify phone

Check if the input a user has entered is a phone number or not (checks to see if phone number is registered, not just that it contains a certain amount of digits) - also fixes validation loop with built-in email validation + removes any text and special characters in message

Your JSON API is POST https://{your-netlify-app-name}.netlify.app/api/functions/verify-phone

Parameters

  • phone - phone

Attributes

This JSON API setups those attributes to bot user:

  • phoneValid - true if email is valid, false otherwise

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.