Long-form API

The long-form API uses a POST request with a json body specifying the actions to perform on input records and the outputs returned in the response. This API supports the full DataPrep functionality and allows for multiple input records.

inputs: Array of objects specifying the input records to perform data manipulation on. Each object in the array is a record and maps a field name string to a value. Fields can be named whatever the end user desires. The field name will be used to refer to a set of values in the actions

actions: An array of objects specifying the data manipulation actions to perform on the input records. Each object in the array is a separate action. Actions are performed in given order and can create new fields or overwrite existing ones. Actions can even be performed on the output of other actions.

output: An array of field names to include in the returned results. Field names must either be original input fields or output fields of an action. Results will be returned in the order they are passed to this parameter.

{
  "inputs": [
    {
      "input_field_1": "input_value_1",
      "input_field_2": "input_value_2",
      "input_field_3": "input_value_3"
    },
    {
      "input_field_2": "input_value_2",
      "input_field_4": "input_value_4"
    }
  ],
  "actions": [
    {
      "name": "action_name_1",
      "inputFields": [
        "input_field_1"
      ],
      "outputFields": [
        "output_field_1",
        "output_field_2",
        "output_field_3"
      ],
      "options": {
        "option_name_1": "option_value_1",
        "option_name_2": "option_value_2"
      }
    },
    {
      "name": "action_name_2",
      "inputFields": [
        "input_field_1"
      ],
      "outputFields": [
        "output_field_1"
      ]
    }
  ],
  "output": [
    "input_field_1",
    "output_field_1",
    "input_field_2",
    "output_field_2",
    "output_field_3"
  ]
}