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 '{
    "inputJson": [
      {
        "partner_id": "CUST-12345",
        "company_name": "acme corporation",
        "company_short_name": "acme corp",
        "legal_form_code": "AG_DE",
        "contact": {
          "phone": "+49 30 12345678",
          "email": "john.doe@acme.com"
        },
        "address": {
          "street_name": "hauptstraße",
          "street_number": "123",
          "city": "berlin",
          "postal_code": "10115",
          "region": "berlin"
        },
        "identifications": [
          {
            "type": "VAT",
            "value": "DE123456789",
            "country": "DE"
          },
          {
            "type": "TAX_ID",
            "value": "12/345/67890",
            "country": "DE"
          }
        ],
        "website": "http://www.acme-corp.com ",
        "industry_code": "62.01",
        "status": "active"
      }
    ],
    "reverse": true,
    "validationSchemaId": "66432427ba96dd27add2ea34"
  }'

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": [
      {}
    ],
    "reverse": "true",
    "validationSchemaId": "66432427ba96dd27add2ea34",
    "dataTransformationDefinition": {
      "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": [ {} ] }

Data Transformation Definitions

Data Transformation Definitions

Operations

Data Transformation Schemas

Data Transformation Schemas

Operations