Runtime API Overview

The main Conductrics API for getting and tracking selections from your agents.

API Usage Overview

While there are a lot of things you can do with it, the Runtime API itself is pretty simple.

There are two conceptual points of interaction with Conductrics:

  1. Get Selections - via the API, you ask one of your agents to make a selection. The agent responds by "selecting" one of its variations. The variations might represent different images, different versions of a page, whether or not to show some kind of widget. It can also be something totally non-visual. That part is up to you.
  2. Send Rewards - as your visitors/users hit "conversion" events such as purchases, signups, CTA button clicks, or any other positive activity, you send rewards back to Conductrics. Conductrics passes these rewards on to any agents that previously made selections for the given visitor/user. The agents use the rewards to keep track of the success rate of each variation.

Both of these things (getting selections or sending rewards) are accomplished by sending one or more commands to the Conductrics API. So, if you just want to get one selection from one agent, you pass in one selection command. If you need selections from three agents (for three different conceptual variations on your side), you pass in three selection commands. If you want to send a reward, you send a reward command.

Using the API Locally vs Web Service

One unusual thing about the Conductrics API is that it can be accessed locally in web pages or mobile apps, or over HTTP as a more traditional Web Service.

  • Locally, via JavaScript - if you are using Conductrics in web pages, you can use the local JavaScript version of the API. Little "snapshots" of your Conductrics agents get compiled into JS files, which you include in your pages like any other. See API Usage via Local JS.

  • Over HTTP, via Web Service - you can also use the API as a traditional REST-style web service. Your agents make their selections and collect their rewards on the Conductrics server. See API Usage via Web Service.

  • In your mobile apps - if you want to use Conductrics in your mobile apps, you can use a "local" version of our API in native iOS, Android, or React Native. You can also use the REST-style web service from your mobile apps. See the Options for Mobile page for more.

Which One to Use?

In some cases it will be obvious to you whether to access the Local API or the Web Service. In other cases it will be a bit of a judgement call. Here are some pros and cons of each to help you decide. Feel free to contact us at Conductrics to discuss what's best for your project.

Pros and Cons for using the Local API:

  • Pro: Agent selections are made instantly.
  • Pro: JavaScript files are served worldwide via CDNs for high availability and fast delivery.
  • Pro: On the web, you can optionally host the JavaScript files yourself, which means you can test and deploy them according to your own schedule without having to manually coordinate rollouts over multiple systems.
  • Con: While the JavaScript code isn't really human-readable, if someone really wanted to they could "reverse engineer" the code to determine what kinds of tests you are running.

Pros and Cons for using the Web Service:

  • Pro: Can be used by any kind of system, not just websites. Think call center automation, kiosks, point-of-sale systems, IOT devices, back-end search systems - anything that can make an HTTP call can use the web service.
  • Pro: Even for websites where you could use the local flavor of the API, if your agents are making selections that you consider to be "sensitive", they can make those selections "behind closed doors" using the web service.
  • Con: While the Web Service version of the API is fast, you are still going out "over the wire" to get selections from your agents. This means that there is necessarily going to be a short delay while your selection/reward commands make a "round trip" to the Conductrics servers and back. In most cases you should expect about 100-200ms total round-trip time, the vast majority of which is in transport.

Either way, the concepts are the same. Once you're set up, actual usage of the API is nearly the same whether you choose to use it locally or via the web service.

Getting Started

Getting Started using Local JavaScript in the Browser

If you've chosen to access the API via local JavaScript, your first step will be to add the appropriate <script> tag to your pages. You can then proceed to send commands into the API to get selections from your agents, or send them rewards when conversion events occur.

Get started here: API Usage via Local JS

Getting Started using the Web Service

If you've chosen to access the API via the web service, you'll need the URL and API Key to use when calling the API over HTTP. You can find them in the "API" section of the Conductrics admin.

Get started here: API Usage via Web Service

Getting Started for Mobile

You have a few options for using Conductrics in your mobile apps.

Get started here: Options for Mobile