Developer Features


The plugin allows you to create server-side integrations or define your conversation logic based on dynamic content. You can make the following HTTP requests:

  • GET
  • POST
  • PUT

In addition, you can pass query string parameters, POST body, and headers to address a various type of custom implementation. It is possible to use user variables as parameters using the double braces syntax to pass user input and NLP response. Here is an example of how to use JSON API in order to pull data from a third-party API:

The response is saved in variable. This can be used inside the text element to print out the result in the following way:

JSON API allows you to implement the following use-cases:

  1. Retrieve dynamic content.
  2. Create server-side integrations, where it will send data to an endpoint whenever a conversation reaches a certain point.
  3. Trigger an event.

Script Block

Script Block allows you to quickly write custom logic inside the conversation builder. Click on script button in the toolbar as shown below to insert a script block:

The entire conversation context is available in the script block. This will let you write custom logic based on user input, entities and variables. The example below shows how to pull data from a weather API and then set it as a context variable for use in the builder:

//script block
import request from 'request';

// get a free API key from
const appId = 'PASTE_YOUR_API_KEY';

exports.handler = (context, done) => {
        url : '',
        qs : {
            lat : context.nlp.entities.location[0].lat,
            lon : context.nlp.entities.location[0].lng,
            appid: appId,
            units: 'imperial'
        json : true
    }, (err, reponse, body)=>{
        if (err){
        // save 
        context.vars.set("weatherData", body);

context parameter have the following properties:

Property NameDescription
args[User input]
nlpContains entities and intents for an expression.
varsSet or get vars to use in the current context.

The args object contains the following properties:

Property NameDescriptionType
senderUnique sender IDString
textInput text.(e.g. Where is San Francisco?)String
eventEvent to trigger an intent. Either text or event is required.Object

event contains the name of the event that is triggered for a user action:

Property NameDescriptionType
nameName of the event (e.g. start) that corresponds to an intent nameString

You can use variables inside the builder in the following way using the double braces syntax:

You can also output in script block using the extension module in the following way:

import Ext from "recime-bot-extension";
const __ = Ext.default;

exports.handler = (context, done) => {
    done(__.text("Hello world"));

Script block can be useful in the following scnearios:

  • Retrieving data from your existing API that you want inject in your conversation context.
  • Construct dynamic response based on user input and entities.

The following libraries are available in the Script Block runtime:

Working with Variables

Use variables to specify a check-point in your conversation or identify a user. You can access a variable using the double braces syntax in the following way:

Here is a list of varaibles accessible from with the conversation scope by channel:

PlatformVariable namecomments
Facebookfirst_name, last_name, profile_pic, gender, locale, timezone--
WeChatfirst_namenickname and set as first_name
Viberfirst_name, last_name--
Telegramfirst_name, last_name--
Websitefirst_name, last_nameYou can override them from the configure section

How to track an user?

You can use the sender variable to track a user specific to a channel.

It is also possible to create your own custom variables using User Variable plugin.

Use variables to trigger a conditional flow as shown below:

Use variables as filter criteria to send a broadcast (a.k.a. push notifications) to a specific number of subscribers:

Capturing User Location

In order to offer location-aware content, promotions to your users, your bot can capture location as user input.

In order to capture a user location, create a "location" block. Location is sent as an user input and can be accessed as a variable in the following way:

args.location contains the following properties:


You can use this variable in JSON API plugin as POST or query string parameter to offer specific content from your database or capture location as part of qualifying a user.

How to send a location to the bot?

A user can send location in the following way for messenger platform:

How can I send my current location in Messenger

In Viber, it is available as a toolbar button, clicking on it will bring up the map to pin your location:

In Telegram, tap on the attachment button and choose Location:

Reusable Custom Modules (Coming Soon)

Publish re-usable custom modules using the Command Line Interface.

Last Updated: 8/20/2018, 9:49:13 AM