What is the “JSON API” Integration in Frontman’s Story-builder Section?

Integrate backend with Frontman to get and post real-time data by simply using the JSON API feature.

JSON API menu

JavaScript Object Notation (JSON) API makes it easy to get and post data, and on the other hand, it also improves the data parsing factors for machines. It’s a user-friendly way to read and write data to and from company databases on run time.

JSON API card functions:

  1. Get: Data transferred through this method is visible and not secure
  2. Post: It is used to send and receive sensitive information.
  3. Enter URL: In this section, paste the JSON API URL from where you want to extract data.
  4. Enter Parameters (Optional): You can pick one or multiple attributes from the provided list, to send along with the API. In case you don’t want to set parameters, then keep this slot empty.

Use Cases of JSON API in Frontman:

  1. To generate dynamic content.
  2. To re-enter a flow.
  3. To get and set user attributes.
  4. Redirect visitors from one block to another.
  5. Play targeted or promotional videos within the chat window.
  6. Integrate your API with the chatbot, and post content directly from your resources.
  7. To start a limited time offers and restrict the visitors’ interaction after a specific time.

Here are a few JSON codes:

  1. Sending simple messages
{
  "entries":[
    {
      "template_type":"message",
      "message":"Hi, greetings from Makerobos" // type:string , max-length:450
    }
  ]
}

2. Sending messages with buttons

{
  "entries":[
      {
        "template_type":"message",
        "message":"click the below button to view the demo.",
        "buttons":[ // maximum 3 buttons
          {
            "type":"url",
            "url":"https://www.makerobos.com",
            "webview_height":"full", // "full" | "small" | "medium" | "new" (opens in new tab)
            "title":"Preview"
          },
          {
            "type":"url",
            "url":"https://www.makerobos.com",
            "webview_height":"small",
            "title":"preview"
          }
        ]
    }
   ]
}

3. Sending carousels

{
  "entries":[
    {
      "template_type":"carousel",
      "shadow":true,
      "slides":[ // maximum 9 slides
          {
            "title":"some title",
            "subtitle":"some description",
            "image_url":"https://someimage.jpg",
            "buttons":[ // maximum three buttons
                {
                  "type":"url",
                  "url":"https://www.makerobos.com",
                  "webview_height":"new",
                  "title":"Preview"
                },
                {
                  "type":"url",
                  "url":"https://www.makerobos.com",
                  "webview_height":"new",
                  "title":"Preview"
                }
              ]
          },
          {
            "title":"some title",
            "subtitle":"some description",
            "Image_url":"https://www.images.com/someimage.jpg"
          }
      ]
     }
    ]
}

4. Sending Images, Videos, Audios

{
  "entries":[
    {
      "template_type":"video", // “image” | “audio” | “video”
      "url":"https://www.youtube.com/watch?v=-JLewvWBkCw",
      "button":{
        "type":"url",
        "url":"https://digital.makerobos.com",
        "webview_height":"small",
        "title":"Preview"
      }
    }
  ]
}

5. Setting attribute

{
  "entries":[
    {
      "template_type":"set_attr",
      "attributes":[
        {
        "attribute":"first_name",
        "value":"John"
        },
        {
        "attribute":"subscribed_email",
        "value":"john@mail.com"
        }
      ]
    }
  ]
}

Here is the, Github link to the above codes

The JSON API integration is only available in business and enterprise plans

Makerobos Help Center