Skip to content

Transformation API (1)

This API possibility to transform string with python code.

Download OpenAPI description
Languages
Servers
Mock server

https://developer.cdq.com/_mock/apis/transformation-api/v1/api-v1/

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://developer.cdq.com/_mock/apis/transformation-api/v1/api-v1/datatransformationdefinitions/c074b9f3-abf0-4f8e-9a20-74deb6cfa2a4/transform \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE' \
  -d '{
    "inputJson": [
      {}
    ],
    "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://developer.cdq.com/_mock/apis/transformation-api/v1/api-v1/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",
      "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