Skip to main content

JSON to fields API reference

API reference for the JSON to fields transform method

Request examples

Minimal request

{
    "api": "hub",
    "action": "createTransform",
    "authToken": "AuthorizedToken",
    "params": {
        "transformName": "TestTransform2",
        "transformActions": [
            {
                "inputFields": [
                    "In1"
                ],
                "outputFields": [
                    "Out1"
                ],
                "transformActionName": "jsonToTableFields",
                "transformParams": {
                    "mapOfPropertiesToFields": [
                        {
                            "propertyPath": "out1",
                            "name": "out1",
                            "type": "VARCHAR",
                            "length": 200
                        }
                    ]
                }
            }
        ]
    }
}
{
    "api": "hub",
    "apiVersion": "1.0",
    "requestId": "00000006",
    "action": "createTransform",
    "authToken": "AuthorizedToken",
    "params": {
        "transformName": "TestTransform2",
        "transformActions": [
            {
                "inputFields": [
                    "In1"
                ],
                "outputFields": [
                    "Out1",
                    "Out2"
                ],
                "transformActionName": "jsonToTableFields",
                "transformParams": {
                    "mapOfPropertiesToFields": [
                        {
                            "propertyPath": "out1",
                            "name": "out1",
                            "type": "VARCHAR",
                            "length": 200
                        },
                        {
                            "propertyPath": "out2",
                            "name": "out2",
                            "type": "DOUBLE"
                        }
                    ]
                },
                "metadata": {
                    "myTag": "my data"
                }
            }
        ]
    },
    "responseOptions": {
        "binaryFormat": "base64",
        "dataFormat": "arrays",
        "numberFormat": "number"
    }

}
{
    "authToken": "AuthorizedToken",
    "result": {},
    "requestId": "00000007",
    "errorCode": 0,
    "errorMessage": ""
}

API reference for the JSON to fields transform method

API referenceJSON hub APIJSON API referenceJSON to fields transformJSON fields

The "params" property is an object that contains an action's parameters. Each action defines its own required and optional properties.

Property summary

Table 1. "params" property summaries

Property

Description

Default

Type

Limits

"transformActions"

specifies "transformAction" objects

Required - No default value

array of objects

"transformName"

specifies the name of a transform process. The name cannot be one of the FairCom-provided transform names

Required - No default value

string

Minimum length: 1
Maximum length: 64


The "transformActions" property is an optional array of "transformAction" objects. It defaults to an empty array.

The "transformParams" property is a required object that can be an empty object or contain one or more properties needed by the "transformAction".

The "mapOfPropertiesToFields" property is a required array of "mapOfPropertiesToFields" objects. It defaults to an empty array.

Example
"mapOfPropertiesToFields": [
  {
    "propertyPath": "out1",
    "name": "out1",
    "type": "VARCHAR",
    "length": 200
  }
]

The "propertyPath" property is a string that specifies the property that will be read in JSON.

The "name" property is a string that specifies the destination in the integration table for the data that was read from the propertyPath.

The "type" property specifies the type of the integration table being written to.

The "length" property is an integer that specifies the length of the "name" property.