Compose the API response for an interactive experiment
You must compose the API response to send data to your organization's website to correctly display the offer or content on your webpage. You can include the offer or content returned by a decision model in the API response.
When you compose the API response you must enter the parameters that your organisation's website requires in order to correctly display the offer or content. You can copy and paste dynamic data from the interactive experiment response into the API response. This is required if you want to use any parameters in the API response that are requested by the dependant website, such as "uri"
, "region"
, and "pointOfSale"
.
You can also compose the API response to include dynamic guest data in a variant. For example, you might want the variant for the interactive experiment to include the guest's first name, location, loyalty number, etc. To do this, you must configure the variant to include the dynamic data so that when the variant executes, the server requests the dynamic data and passes it to your organisation's website.
To compose the API response for an interactive experiment:
-
In the API editor, on the API tab, compose the API response using FreeMarker.
TipYou can copy and paste dynamic data from the guest data model and decision model response, as required. You can also type directly in the API editor to replace parts of the response with context attributes such as
${guest.firstName}.
-
Click Save.
-
Click to close the API editor.
NoticeWe recommend that you set a timeout of 600 milliseconds on our system's response to cover 100% of our response times. This does not include any latent network time in communicating with our servers. You should take into account the location of the client servers which differs per client. All timeouts that you set for clients that depend on API responses should be adjusted accordingly, for example, UI rendering of dynamic offers.