Scripts | Vantage CX - 1.4 - Scripts - Vantage Customer Experience

Vantage Customer Experience User Guide

Product
Vantage Customer Experience
Release Number
1.4
Release Date
June 2021
Content Type
User Guide
Publication ID
B035-3800-099K
Language
English (United States)

The Scripts management tool allows you to create, maintain, and validate Groovy scripts and host them as REST APIs within Vantage CX.

In a script, code can call other external APIs to get additional data. For example, you could use scripts in the following situations:
  • You have a credit card transaction message from an event-streaming platform and you need to make a call to get a valid Vantage CX Customer ID before calling the DTM API
  • Your returned messages are from a DTM/GTM call. You need to transform the messages into the correct payload and API format before sending them to the external channel.

You can write the script code or copy and paste it from another source. If the data changes, you can update the scripts.

To call a custom API endpoint defined in a script, use: https://servername/api-host/custom/<endpoint> where <endpoint> is the custom endpoint defined in the script.

For example, the Script Examples defines two endpoints:
  • @GetMapping("/mymessages/{customerId}")
  • @PostMapping("/purchase-event")

To call these endpoints use GET https://servername/api-host/custom/mymessages/Cust123456 or POST https://servername/api-host/custom/purchase-event, respectively.