This API possibility to transform string with python code.
Transformation API (1)
https://idp.cdq.com/_mock/apis/transformation-api/api-v1/
https://api.corporate-data-league.ch/transformation-api/soap/v1/
https://api.corporate-data-league.ch/transformation-api/
Set to 'true' if you want to apply the reverse mapping
- Mock server
https://idp.cdq.com/_mock/apis/transformation-api/api-v1/datatransformationdefinitions/{id}/transform
- Production SOAP
https://api.corporate-data-league.ch/transformation-api/soap/v1/datatransformationdefinitions/{id}/transform
- Production
https://api.corporate-data-league.ch/transformation-api/datatransformationdefinitions/{id}/transform
curl -i -X POST \
https://idp.cdq.com/_mock/apis/transformation-api/api-v1/datatransformationdefinitions/c074b9f3-abf0-4f8e-9a20-74deb6cfa2a4/transform \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"inputJson": [
{}
],
"reverse": "true",
"validationSchemaId": "66432427ba96dd27add2ea34"
}'{ "resultJson": [ {} ] }
Set to 'true' if you want to apply the reverse mapping
- Mock server
https://idp.cdq.com/_mock/apis/transformation-api/api-v1/public/datatransformationdefinitions/{id}/transform
- Production SOAP
https://api.corporate-data-league.ch/transformation-api/soap/v1/public/datatransformationdefinitions/{id}/transform
- Production
https://api.corporate-data-league.ch/transformation-api/public/datatransformationdefinitions/{id}/transform
curl -i -X POST \
https://idp.cdq.com/_mock/apis/transformation-api/api-v1/public/datatransformationdefinitions/c074b9f3-abf0-4f8e-9a20-74deb6cfa2a4/transform \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-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"
}
]
}'{ "resultJson": [ {} ] }
Set to 'true' if you want to apply the reverse mapping
ID of Json validation schema
- Mock server
https://idp.cdq.com/_mock/apis/transformation-api/api-v1/datatransformationdefinitions/transform
- Production SOAP
https://api.corporate-data-league.ch/transformation-api/soap/v1/datatransformationdefinitions/transform
- Production
https://api.corporate-data-league.ch/transformation-api/datatransformationdefinitions/transform
curl -i -X POST \
https://idp.cdq.com/_mock/apis/transformation-api/api-v1/datatransformationdefinitions/transform \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-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"
}
],
"customTransformations": [
{
"name": "Code above.",
"code": "Code above.",
"language": "python"
}
]
}
}'{ "resultJson": [ {} ] }
Set to 'true' if you want to apply the reverse mapping
ID of Json validation schema
- Mock server
https://idp.cdq.com/_mock/apis/transformation-api/api-v1/public/datatransformationdefinitions/transform
- Production SOAP
https://api.corporate-data-league.ch/transformation-api/soap/v1/public/datatransformationdefinitions/transform
- Production
https://api.corporate-data-league.ch/transformation-api/public/datatransformationdefinitions/transform
curl -i -X POST \
https://idp.cdq.com/_mock/apis/transformation-api/api-v1/public/datatransformationdefinitions/transform \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-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
}'{ "resultJson": [ {} ] }
ID of the message transformation which should be applied.
URL of the original message to be transformed.
- Mock server
https://idp.cdq.com/_mock/apis/transformation-api/api-v1/datatransformationdefinitions/transformMessage
- Production SOAP
https://api.corporate-data-league.ch/transformation-api/soap/v1/datatransformationdefinitions/transformMessage
- Production
https://api.corporate-data-league.ch/transformation-api/datatransformationdefinitions/transformMessage
curl -i -X POST \
https://idp.cdq.com/_mock/apis/transformation-api/api-v1/datatransformationdefinitions/transformMessage \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"configurationId": "/sap-odm/v2",
"url": "referencedata/rest/businesspartners/lookup",
"message": {},
"type": "REQUEST"
}'{ "transformedMessage": {} }
- Mock server
https://idp.cdq.com/_mock/apis/transformation-api/api-v1/datatransformationdefinitions/proxyMessage
- Production SOAP
https://api.corporate-data-league.ch/transformation-api/soap/v1/datatransformationdefinitions/proxyMessage
- Production
https://api.corporate-data-league.ch/transformation-api/datatransformationdefinitions/proxyMessage
curl -i -X POST \
https://idp.cdq.com/_mock/apis/transformation-api/api-v1/datatransformationdefinitions/proxyMessage \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Cdq-Forwarded-Path: /api/v1/lookup' \
-H 'Content-Type: application/json' \
-H 'X-Forwarded-Method: GET' \
-H 'X-Message-Transformation-Configuration-Id: c074b9f3-abf0-4f8e-9a20-74deb6cfa2a4'"example"
- Mock server
https://idp.cdq.com/_mock/apis/transformation-api/api-v1/transformation
- Production SOAP
https://api.corporate-data-league.ch/transformation-api/soap/v1/transformation
- Production
https://api.corporate-data-league.ch/transformation-api/transformation
curl -i -X POST \
https://idp.cdq.com/_mock/apis/transformation-api/api-v1/transformation \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"transformationScript": "code",
"contentToTransform": "content"
}'OK
The transformation script can return one string or map of key values. Depending on the return type in the script, the transformationResults will have different structure:
- when a script returns a string, the result array will have one element without key
- when a script returns a map, then the array will have filled the key and values
{ "inputJson": "{...}", "transformationResults": [ { … } ] }