Skip to content

Transformation API (1)

This API possibility to transform string with python code.

Download OpenAPI description
Languages
Servers
Production

https://api.cdq.com/transformation/rest/

Operations

Request

Transform JSON string using data transformation definition ID.

Security
apiKey
Path
idstringrequired

ID of the data transformation definition.

Example: c074b9f3-abf0-4f8e-9a20-74deb6cfa2a4
Bodyapplication/jsonrequired
inputJsonArray of objects(JsonObject)

List of JSON objects to transform.

reverseboolean(TransformReverseToggle)

Set to 'true' if you want to apply the reverse mapping

Default false
Example: "true"
validationSchemaIdstring(JsonValidationSchemaId)

ID of Json validation schema

Example: "66432427ba96dd27add2ea34"
curl -i -X POST \
  https://api.cdq.com/transformation/rest/datatransformationdefinitions/c074b9f3-abf0-4f8e-9a20-74deb6cfa2a4/transform \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE' \
  -d '{
    "imports": [
      {
        "id": "c074b9f3-abf0-4f8e-9a20-74deb6cfa2a4"
      }
    ],
    "name": "My DTD",
    "direction": "INBOUND",
    "type": {
      "name": "BUSINESS_PARTNER",
      "technicalKey": "BUSINESS_PARTNER"
    },
    "mappings": [
      {
        "sourceAttributes": [
          "businessPartner.record"
        ],
        "sourceSelections": [
          {
            "selectionType": "CONCATENATION",
            "value": ","
          }
        ],
        "targetAttributes": [
          "businessPartner.externalId"
        ],
        "targetTransformations": [
          {
            "constantValue": "constant",
            "targetAttributes": [
              "businessPartner.externalId"
            ],
            "transformationName": "CAPITALIZE",
            "defaultValue": "default",
            "transformationType": "CAPITALIZE"
          }
        ],
        "ignoredValues": [
          "ignored value"
        ]
      }
    ],
    "reverseMappings": [
      {
        "sourceAttributes": [
          "businessPartner.record"
        ],
        "sourceSelections": [
          {
            "selectionType": "CONCATENATION",
            "value": ","
          }
        ],
        "targetAttributes": [
          "businessPartner.externalId"
        ],
        "targetTransformations": [
          {
            "constantValue": "constant",
            "targetAttributes": [
              "businessPartner.externalId"
            ],
            "transformationName": "CAPITALIZE",
            "defaultValue": "default",
            "transformationType": "CAPITALIZE"
          }
        ],
        "ignoredValues": [
          "ignored value"
        ]
      }
    ],
    "valueMappings": [
      {
        "sourceConditions": [
          {
            "sourceValue": "AU",
            "sourceAttribute": "$.identifications[*].country.code",
            "sourceRegex": "^GR\\..{1,}"
          }
        ],
        "sourceValue": "AE1",
        "targetValue": "AE",
        "targetAttribute": "$.identifications[*].country.code",
        "sourceAttribute": "$.identifications[*].country.code",
        "disabled": "false"
      }
    ],
    "values": [
      {
        "sourceValue": "AE1",
        "sourceAttribute": "identifications[*].indentificationType.code"
      }
    ]
  }'

Responses

OK

Bodyapplication/json
resultJsonArray of objects(JsonObject)

List of transformed JSON objects.

Response
application/json
{ "resultJson": [ {} ] }

Transform JSON with Data Transformation Definition

Request

Transform JSON string using provided data transformation definition.

Security
apiKey
Bodyapplication/json
inputJsonArray of objects(JsonObject)

List of JSON objects to transform.

reverseboolean(TransformReverseToggle)

Set to 'true' if you want to apply the reverse mapping

Default false
Example: "true"
validationSchemaIdstring(JsonValidationSchemaId)

ID of Json validation schema

Example: "66432427ba96dd27add2ea34"
dataTransformationDefinitionobject(DataTransformationDefinitionCreate)

Create data transformation definition.

curl -i -X POST \
  https://api.cdq.com/transformation/rest/datatransformationdefinitions/transform \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE' \
  -d '{
    "inputJson": [
      {
        "displayId": "4711",
        "organization": {
          "globalLocationNumber": "7601234000008",
          "legalForm": {
            "code": "AG",
            "name": "Aktiengesellschaft"
          },
          "nameDetails": {
            "formattedOrgName": "CDQ AG",
            "scriptVariants": [
              {
                "scriptCode": {
                  "code": "LATN"
                }
              }
            ]
          }
        },
        "addressData": [
          {
            "emailAddresses": [
              {
                "address": "info@cdq.ch"
              }
            ],
            "websites": [
              {
                "url": "https://www.cdq.com "
              }
            ],
            "organizationPostalAddress": {
              "building": "CDQ Campus",
              "careOf": "c/o Data Quality Office",
              "country": {
                "code": "CH"
              },
              "district": {
                "name": "St. Gallen District"
              },
              "door": "12B",
              "floor": "3",
              "postCode": "9008",
              "houseNumber": "4",
              "primaryRegion": {
                "code": "SG",
                "name": "St. Gallen"
              },
              "secondaryRegion": {
                "name": "Eastern Switzerland"
              },
              "tertiaryRegion": {
                "name": "Lake Constance Region"
              },
              "street": {
                "name": "Lukasstrasse"
              },
              "town": {
                "name": "St. Gallen"
              },
              "scriptVariants": {
                "scriptCode": {
                  "code": "DE"
                }
              }
            },
            "usages": [
              {
                "usage": {
                  "code": "REGISTERED"
                }
              },
              {
                "usage": {
                  "code": "MAILING"
                }
              }
            ]
          }
        ],
        "identifications": [
          {
            "country": {
              "code": "CH"
            },
            "identificationNumber": "CHE-218.608.887",
            "identificationType": {
              "code": "CH_UID"
            },
            "institute": "Swiss Commercial Register",
            "region": {
              "code": "SG"
            }
          }
        ],
        "taxNumbers": [
          {
            "taxNumber": "CHE-218.608.887MWST",
            "taxNumberType": {
              "code": "CH_VAT_ID"
            }
          }
        ]
      },
      {
        "displayId": "5712",
        "organization": {
          "globalLocationNumber": "4000123456786",
          "legalForm": {
            "code": "AG",
            "name": "Aktiengesellschaft"
          },
          "nameDetails": {
            "formattedOrgName": "VOLKSWAGEN (VW)",
            "scriptVariants": [
              {
                "scriptCode": {
                  "code": "LATN"
                }
              }
            ]
          }
        },
        "addressData": [
          {
            "emailAddresses": [
              {
                "address": "contact@volkswagen.de"
              }
            ],
            "websites": [
              {
                "url": "https://www.volkswagen.com "
              }
            ],
            "organizationPostalAddress": {
              "building": "VW Headquarter",
              "careOf": "",
              "country": {
                "code": "DE"
              },
              "district": {
                "name": "Wolfsburg Stadtbezirk"
              },
              "door": "1",
              "floor": "EG",
              "postCode": "38440",
              "houseNumber": "2",
              "primaryRegion": {
                "code": "NI",
                "name": "Lower Saxony"
              },
              "secondaryRegion": {
                "name": "Braunschweig Region"
              },
              "tertiaryRegion": {
                "name": "Weser-Ems"
              },
              "street": {
                "name": "Berliner Ring"
              },
              "town": {
                "name": "Wolfsburg"
              },
              "scriptVariants": {
                "scriptCode": {
                  "code": "DE"
                }
              }
            },
            "usages": [
              {
                "usage": {
                  "code": "REGISTERED"
                }
              },
              {
                "usage": {
                  "code": "VISITING"
                }
              }
            ]
          }
        ],
        "identifications": [
          {
            "country": {
              "code": "DE"
            },
            "identificationNumber": "HRB 100484",
            "identificationType": {
              "code": "DE_HRB"
            },
            "institute": "Amtsgericht Braunschweig",
            "region": {
              "code": "NI"
            }
          }
        ],
        "taxNumbers": [
          {
            "taxNumber": "DE115235681",
            "taxNumberType": {
              "code": "DE_VAT_ID"
            }
          }
        ]
      },
      {
        "displayId": "8715",
        "organization": {
          "globalLocationNumber": "8000000123451",
          "legalForm": {
            "code": "SPA",
            "name": "Società per Azioni"
          },
          "nameDetails": {
            "formattedOrgName": "Enel S.p.A.",
            "scriptVariants": [
              {
                "scriptCode": {
                  "code": "LATN"
                }
              }
            ]
          }
        },
        "addressData": [
          {
            "emailAddresses": [
              {
                "address": "info@enel.com"
              }
            ],
            "websites": [
              {
                "url": "https://www.enel.com "
              }
            ],
            "organizationPostalAddress": {
              "building": "Enel Headquarters",
              "careOf": "",
              "country": {
                "code": "IT"
              },
              "district": {
                "name": "Municipio II"
              },
              "door": "5",
              "floor": "7",
              "postCode": "00198",
              "houseNumber": "125",
              "primaryRegion": {
                "code": "LAZ",
                "name": "Lazio"
              },
              "secondaryRegion": {
                "name": "Rome Metropolitan City"
              },
              "tertiaryRegion": {
                "name": "Central Italy"
              },
              "street": {
                "name": "Viale Regina Margherita"
              },
              "town": {
                "name": "Roma"
              },
              "scriptVariants": {
                "scriptCode": {
                  "code": "IT"
                }
              }
            },
            "usages": [
              {
                "usage": {
                  "code": "REGISTERED"
                }
              },
              {
                "usage": {
                  "code": "BILLING"
                }
              }
            ]
          }
        ],
        "identifications": [
          {
            "country": {
              "code": "IT"
            },
            "identificationNumber": "00811720580",
            "identificationType": {
              "code": "IT_FISC_ID"
            },
            "institute": "Registro Imprese Roma",
            "region": {
              "code": "LAZ"
            }
          }
        ],
        "taxNumbers": [
          {
            "taxNumber": "IT0003128367",
            "taxNumberType": {
              "code": "IT_VAT_ID"
            }
          }
        ]
      }
    ],
    "reverse": false
  }'

Responses

OK

Bodyapplication/json
resultJsonArray of objects(JsonObject)

List of transformed JSON objects.

Response
application/json
{ "resultJson": [ {} ] }

Data Transformation Definitions

Data Transformation Definitions

Operations

Data Transformation Schemas

Data Transformation Schemas

Operations