Skip to main content
Users
CloudPortalLogin
  • Powered byPowered by
Introduction to Sitecore Personalize
Managing accounts and system settings
Identifying guests
Introduction to experiments
Introduction to experiences
Decisioning
View dashboards
Developer Center
Connecting to an external system
Using client-side JavaScript
Using server-side JavaScript
AI in Personalize
Glossary
  • Sitecore Personalize
  • Introduction to experiences
  • Introduction to interactive experiences
  • Compose the API response for an interactive experience

Compose the API response for an interactive experience

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 experience 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 experience:

  1. In the API editor, on the API tab, compose the API response using FreeMarker.

    Composing the API response using FreeMarker
    Tip

    You 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}.

  2. Click Save.

  3. Click to close the API editor.

    Notice

    We 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.

Do you have some feedback for us?

If you have suggestions for improving this article,

Privacy policySitecore Trust CenterCopyright © 1999-2026 Sitecore