Interaction JavaScript Quick Start

Last updated: 2020-04-28 Contributors John WangByrne ReesePaco Vu
Edit this page

Welcome to the Engage Platform. In this Quick Start, we are going to help you generate a list of threads that agents can engage customers via. Obtaining a reference to a thread is the first step in taking action on an interaction with a customer, including creating an intervention. The Quick Start will have you up and running in minutes. Let's get started.

Obtain Access Key

The first thing you need to do is obtain an API Access Token if you do not already have one. Access tokens can be created and/or accessed via the "API access token" area in the "Admin" area of your Engage portal.

How to generate an Engage API access token
  1. Login to your Engage portal and click on the "Admin" menu located in the top, horizontal menu.

  2. Select "API access tokens" towards the bottom of the left hand menu.

  3. You should see a list of access tokens if any have been provisioned. Select the token, or click the "+" button to create a new one.

  4. Finally, enter a label/description for your token, and select an Agent on which the token will act on behalf of. Make sure the token is "enabled" and click "Save."

    API access token

Make note of the access token generated as you will need it later.

Create and Edit threads.js

Create a file called threads.js. Be sure to edit the variables in <ALL CAPS> with your app's credentials.

var https = require('https')

const API = "/1.0/content_threads"

var headers = {
        'Authorization': "Bearer " + ACCESS_TOKEN

var options = {host: SERVER, path: API, method: 'GET', headers: headers};

var get_req = https.get(options, function(res) {
      var response = ""
      res.on('data', function (chunk) {
          response += chunk
        }).on("end", function(){
          if (res.statusCode == 200)
    }).on('error', function(e) {

Run Your Code

You are almost done. Now run your script.

$ node threads.js

Need Help?

Having difficulty? Feeling frustrated? Receiving an error you don't understand? Our community is here to help and may already have found an answer. Search our community forums, and if you don't find an answer please ask!

Search the forums »

What's Next?

When you have successfully made your first API call, it is time to take your next step towards building a more robust Engage application.

Explore the REST API »