File format: JSON

JavaScript Object Notation (JSON) is language-independent data format that is similar to JavaScript.

Note

This topic is about standalone JSON files. JSON data that is sent to the Streaming API is converted to NDJSON format.

Pull JSON files

To pull JSON files to Amperity:

  1. Select a filedrop data source.

  2. Configure a courier for the location and name of the JSON file.

  3. Define a feed to associate the fields in the JSON file with semantic tags for customer profiles and interactions, as necessary.

Data sources

Pull JSON files to Amperity using any one of the following data sources:

Recommendations

When using JSON files, it is recommend to:

  • Do use simple nested data structures; do not use nested array data structures

    DO

    {
      "employee":{ "name":"John", "age":30, "city":"New York" }
    }
    

    DO NOT

    {
      "employees":[ "John", "Anna", "Peter" ]
    }
    
  • Quote string data

  • Quote date values and use the supported date format

  • Ensure numeric data is not quoted

  • Encode files in UTF-8 or UTF-16. Amperity automatically detects the 2-byte header present with the UTF-16 encoding format. If the 2-byte header is missing, the file is treated as UTF-8.

    Caution

    JSON files that are used as source data with Amperity must follow RFC 8259 , which requires using (at a minimum) the UTF-8 encoding format.

  • Compress files prior to encryption using ZIP, GZIP, and/or TAR

  • Encrypt files using PGP; compression will not reduce the size of an encrypted file

Load data

Use a feed to associate fields in the JSON file with semantic tags and a courier to pull the JSON file from its upstream data source.

Couriers

A courier brings data from an external system to Amperity.

A courier must specify the location of the JSON file, and then define how that file is to be pulled to Amperity.

  1. File settings

  2. Feed selection

File settings

Use the File settings section of the courier configuration page to specify the path to the JSON file and to define formattting within the file.

Feed selection

Use the Feed selection section of the courier configuration page to identify the feed for which this courier pulls data, and then files are loaded.

From the Load type dropdown select one of:

  • Load Use this option to load data to the associated domain table.

  • Spark Use this option to load data when the JSON file contains complex types, such as nested objects and arrays.

  • Truncate and load Use this option to delete all rows in the associated domain table, and then load data.

Feeds

A feed defines how to load data into a domain table, including specifying required columns and columns with semantic tags for customer profile (PII) or transactions data.

Apply profile (PII) semantics to customer records and transaction, and product catalog semantics to interaction records. Use blocking key (bk), foreign key (fk), and separation key (sk) semantic tags to define how Amperity should understand values that exist across data sources.

Important

A feed will use the first record in a JSON file to determine its schema in the Feed Editor. If records contain optional fields and those records are not the first record you must add those fields to the feed definition manually.

Send JSON files

Amperity can send JSON files to downstream workflows using any of the following destinations: