Interact API dataflow
The following figure shows a simple implementation of the Interact API. A visitor logs into a web site and navigates to a page which displays offers. The visitor selects an offer and logs out. While the interaction is simple, there are several events which occur both in the touchpoint and the runtime server.
When a visitor logs in, this triggers a startSession.
Diagram showing simple implementation of the Interact API dataflow
In this example, the startSession method does four things. First, it creates a new runtime session. Second, it sends a request to load the customer profile data into the session. Third, it sends a request to use the profile data and start an interactive flowchart to place the customer into segments. This flowchart run is asynchronous. Fourth, the runtime loads any offer suppression and global and individual offer treatment information into the session. The session data is held in memory for the duration of the session.
The visitor navigates the site until the visitor reaches a pre-defined interaction point. In the figure, the second interaction point (Select choice) is a place where the visitor clicks a link that presents a set of offers. The touchpoint manager configured the link to trigger an executeBatch method.
Diagram of the API call triggering the executeBatch method
The executeBatch method enables you to call more than one method in a single call to the runtime server. This particular executeBatch calls two other methods, getOffers and postEvent. The getOffers method requests a list of offers. The runtime uses the segmentation data, the offer suppression list, the treatment rules, and the learning module to propose a set of offers. The runtime returns a set of offers which are displayed on the content page.
The postEvent method triggers one of the events defined in the design environment. In this particular case, the event sends a request to log the offers presented to contact history.
The visitor selects one of the offers (Pick offer).
Diagram showing the postEvent method
The button associated with selecting the offer is configured to send another postEvent method. This event sends a request to log the offer acceptance to response history.
The visitor, after selecting the offer, is finished with the web site and logs out. The log out command is linked to the endSession method.
Diagram showing the end of the API workflow (the endSession method)
The endSession method closes the session. If the visitor forgets to log out, there is a configurable session timeout to ensure that all sessions eventually end. If you want to keep any of the data passed to the session, such as information included in parameters in the startSession or setAudience methods, work with the person who creates interactive flowcharts. The person who creates an interactive flowchart can use the Snapshot process to write that data to a database before the session ends and that data is lost. You can then use the postEvent method to call the interactive flowchart containing the Snapshot process.
This example is very simple (the visitor only takes four actions - log in, navigate to page that displays offers, select an offer, and log out - which is a simple interaction) to show the basics of how the API works between your touchpoint and the runtime environment. You can design your integration to be as complicated as you need (within the limits of your performance requirements).