IntelliTicks
  • Introduction
  • Getting Started
    • Overview
    • Build your first playbook
      • Start with Pre-build Templates
      • Start from scratch
  • Installation
    • IntelliTicks Plugin Script
    • Plugin Installation
  • Facebook Messenger Bot
    • Getting Started
      • Connect Facebook Page
      • Link Playbook to Messenger
    • Testing FB Messenger Bot
  • WhatsApp Bot
    • Benefits of WhatsApp Chatbots
    • Getting Started
    • FAQs
  • AI Builder
    • Playbooks
    • Nodes
      • Add and Send Data
        • Text
        • Image
        • Links
        • Youtube
        • Gallery
        • Dynamic Node
      • Collect User Data
        • Quick Reply
        • Form
        • Datepicker
        • Web View
        • Payment
        • Rating
        • Slider
        • Ask Question
        • Mutli Selection Reply
        • Quick Reply (with branches)
      • Redirect Users
        • URL redirect
        • Conditional branching
        • Go to Playbook
        • Jump to node
      • Export & Import
        • JSON API
      • Connect Users To A Human
        • Notify Agent
        • End Automation
      • Additional
        • Wait
        • Client Javascript
        • Actions
    • Actions
    • FAQ Training
    • Keyword Training
    • Advanced
      • Advanced Actions
  • Flash Responses
    • Flash Response
    • Create Flash Response
    • Using Flash Response
  • Customizing Platform
    • Widget
      • Theme Customization
      • Chat Widget Texts in Local Language
      • Adding Start Over button
      • URL Rules
      • Advanced Customization
        • How to Easily Add Custom CSS to Chat Widget
    • Chat icon/Bot Profile Photo
    • Different chatbot on each URLs
  • Integrations
    • WordPress Integration
    • Shopify Integration
    • Shopify Installation via Private Apps
    • Google Analytics
    • Magento Integration (1.x)
    • Magento Integration (2.x)
    • LeadSquared Integration
    • Marketo Integration
    • Salesforce Integration
    • Zapier Integration
      • Data Available in Zapier
    • Zoho CRM Integration
    • Wix Integration
    • Custom/in-house CRM integration
  • How to
    • Change the Default Playbook
    • Schedule meetings on calendar
      • How to integrate calendly for meetings
      • How to integrate Acquity for meetings
      • How to Integrate YouCanBook for meetings
    • Block a User
    • Delete a User
    • Hide trigger message from website
    • How to show chatbot in right middle of website
    • Start chatbot on a button click
    • Create chatbot landing page
    • Customize Landing Page Link
    • Enable Notifications on browser
    • Popup bot on Facebook page automatically
    • How to send data to chatbot via Javascript
  • Growth Hacks
    • Facebook Retargeting
    • Messenger Ads to chatbot
  • Troubleshooting
    • Messenger Bot is not working as expected
    • How do I remove the Messenger app in Shopify?
    • Push Notification Issues
  • Partnerships
    • White-labeled Chat Platform
    • Affiliate Partnership
  • Miscellaneous
    • Languages Supported
Powered by GitBook
On this page

Was this helpful?

  1. AI Builder
  2. Nodes
  3. Export & Import

JSON API

PreviousExport & ImportNextConnect Users To A Human

Last updated 4 years ago

Was this helpful?

The JSON API Node is used to send or receive data from external service using REST API and optionally create dynamic nodes based on some logic written in JavaScript, which uses the response of the API.

This is an advanced node. You need to have the knowledge of Javascript to use this node.

To create a JSON API node add the node and following the steps below.

  1. Select appropriate Req Type. Currently GET, POST, PUT, PATCH, and DELETE are supported.

  2. Enter the URL of API. URL can contain dynamic parameters such as {{name}}, {{email}} etc and the system would replace these with actual values for each user. for more details on available variables.

  3. For POST, PUT, PATCH, and DELETE requests, please enter the body of the request. The body can also contain dynamic parameters similar to the above point.

  4. You need to write the body of a function that takes user and response(res) as parameters and returns a list of nodes. Below is the format of the function. Currently, only JSON response is supported. res will be the parsed JSON object.

    function(user, res) {//res is json object returned by API
        //your logic goes here
        return {
            nodes:[]
        };
    }

    You only need to write the body of the function. This function is similar to the one in Dynamic node, except that the function receives the response from the API as an extra parameter res

Please check docs of .

Examples

1. Fetching data from server to show carousel dynamically

In this example we will be asking whether she wants to see the demos or guide for the chatbot, then get the relevant videos from API and show them in the chatbot in the form of carousal.

Demo API: https://raw.githubusercontent.com/Quick-Reply/test-data/master/demo.json

Video guide API: https://raw.githubusercontent.com/Quick-Reply/test-data/master/guide.json

Please note that the above urls are case-sensitive.

Steps to configure the

var cardNode = {
  "node_type": "CAROUSEL",
  "elements": []
};
for(var i=0;i<res.length;i++) {
    cardNode.elements.push({
        title: res[i].name,
        subtitle: res[i].description,
        image_url: res[i].image,
        buttons: [{
            link_type: "LINK",
          open_in_new_tab: true,
          title: "View video",
          url: res[i].link
        }]
    });
}
return {
    nodes:[cardNode]
};

Now you can test the playbook. and it would work as expected.

If you are facing any issue, please contact us on support@intelliticks.com

Dynamic node for more details
Please check templatization