Downloading events from Acoustic Exchange Toolkit provides the eventsDownload script to download event data from Acoustic Exchange to a to a file in your local environment. You can run the script manually or as a scheduled job.
Log in to Acoustic Exchange to confirm that you have configured an event subscription to the destination endpoint.
The eventsDownload script calls the v1/eventfiles API to download the events files. Calling the API initiates a secure file download. The event data is downloaded in JSON format to the directory that you specify in the lzocal.download.dir property in config.properties.
The Acoustic Exchange Toolkit transforms the downloaded JSON object into a TSV file.
The default local download directory is $CU_HOME/AppData/eventsDownload, but it can be customized in the config.properties file.

- In the conf directory, verify the following settings in the config.properties file.
ubx.api.service.url=http://<server-name>:<port>
. The service URL for Acoustic Exchange public APIs. The path must include the server and port that Acoustic Exchange assigns to your Acoustic Exchange account.
ubx.endpoint.eventfiles.numFilesInList=<number>
The number of files in the list returned when the eventfiles API is called.
local.download.dir=%CU_HOME%/AppData/eventsDownload
. The directory where the downloaded files are saved.
dbinsert.keep.processed.files=true.
 If set to true, after event import, the TSV file are moved to the dataProcessed directory. If set to False, after import, the TSV file is deleted and the JSON is not moved.
- From the %CU_HOME%/bin folder, run
eventsDownload.bat [-c <config properties file>]
or eventsDownload.sh [-c <config properties file>]Â
By default, Acoustic Exchange downloads the event data to %CU_HOME%/AppData/eventsDownload.
Use the –c option to define alternate configurations. When you specify this option, properties in the alternate configuration file override the toolkit default configuration. Specify the path to the alternate location and file name. Do not rename the default properties file.
The Acoustic Exchange toolkit downloads event data from Acoustic Exchange in JSON format. When the event data has finished downloading, the eventsDownload script converts JSON objects to TSV format.
After the eventsDownload script finishes downloading the event data, the event files are deleted from the Acoustic Exchange server.
Acoustic Exchange event types
Acoustic Exchange defines several types of recognized events and organizes them into classes that are based loosely on the channel in which the events are observed.
Acoustic Exchange also recognizes custom events that are defined by Acoustic Exchange Business Partners, but only after consultation and agreement on the event name, event code, and support for event attributes. Such consultation helps ensure that Acoustic Exchange can correctly recognize and process the data that the custom event promises to deliver.
For more information about Acoustic Exchange event types, see Acoustic Exchange event type directory and Dynamic Event Library
Â
JSON format for download event data
Â
The Acoustic Exchange events are serialized JSON objects in the downloaded files. Each file can contain data for multiple events.
The Acoustic Exchange Toolkit downloads event data in the following JSON format.
{
"provider" : "<string>",
"source" : "<string>",
"channel" : "<string>",
"x1id" : "<string>",
"identifiers" :
[
{ "name" : "<string>","value" : "<string>" },
{ "name" : "<string>","value" : "<string>" }
],
"events" :
[
{
"code" : "<string>",
"timestamp" : "<timestamp>",
"attributes" :
[
{"name" : "<string>", "value" : "<value>", "type" : "<type>" } ,
{"name" : "<string>", "value" : "<value>", "type" : "<type>" }
] }
]
}
Â
After it downloads the event data, the eventsDownload script transforms the JSON object into a TSV file.
The first line in the TSV file contains the header names. The identifiers and attributes might be different for different event types, but all identifiers and attributes are added to the header. The data value of the identifier or attribute that does not belong to an event code is blank for that row.
The following table illustrates an example of the relationship between identifiers and attributes in the JSON to the first line of the TSV file.
JSON |
TSV header |
provider |
provider |
source |
source |
channel |
channel |
x1id |
x1id |
Identifiers[i].name |
identifiers_<string_value> |
event.code |
event_code |
event.timestamp |
event_timestamp |
event.attributes[i].value |
event_attributes_<string_value> |
Â
 The following JSON sample and table illustrate how Acoustic Exchange maps the JSON data to a tab-separated file.Â
Â
{
"provider": "IBM",
"source" : "Digital Analytics",
"channel": "Web",
"x1Id": "81147632-a3fe-43a5-b0c8-6289ca9302bc"
"identifiers":
[
{ "name": "email", "value": "slmoore@example.com" },
{ "name": "DA_cookie_id", "value": "098098-adfsfd-9323ad-78sdfs" }
],
"events":
[
{
"code" : "cartPurchase",
"timestamp": "2015-03-18T13:55:06+00:00",
"attributes":
[
{ "name": "productId", "value": "d12345" },
{ "name": "productName", "value": "Widget ABC" },
{ "name": "basePrice", "value": "200.00", "type" : "number" },
{ "name": "quantity", "value": "2", "type" : "number" }
] },
{
"code" : "cartPurchase",
"timestamp": "2015-03-18T13:55:06+00:00",
"attributes":
[
{ "name": "productId", "value": "d123465" },
{ "name": "productName", "value": "Widget 123" },
{ "name": "basePrice", "value": "13.00", "type" : "number" },
{ "name": "quantity", "value": "1", "type" : "number" }
] }
]}
 Stucture of the corresponding TSV file.
SV Header |
Event 1 |
Event 2 |
Event <n> |
provider |
IBM |
IBM |
 |
source |
Digital Analytics |
Digital Analytics |
 |
channel |
web |
web |
 |
x1id |
81147632-a3fe-43a5- b0c8-6289ca9302bc |
81147632-a3fe-43a5- b0c8-6289ca9302bc |
 |
identifier_email |
slmoore@example.com |
slmoore@example.com |
 |
identifier_cookieid |
098098-adfsfd-9323ad-78sdfs |
098098-adfsfd-9323ad-78sdfs |
 |
event_code |
cartPurchase |
cartPurchase |
 |
event_timestamp |
2015-03-18T13:55:06+00:00 |
2015-03-18T14:08:36+00:00 |
 |
event_attribute_productid |
d12345 |
d123456 |
 |
event_attribute_productname |
Widget ABC |
Widget 123 |
 |
event_attribute_baseprice |
200.00 |
13.00 |
 |
event_attribute_quantity |
2 |
1 |
 |
Â