This API possibility to transform string with python code.
Transformation API (1)
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/
Bodyapplication/jsonrequired
Set to 'true' if you want to apply the reverse mapping
Default false
Example: "true"
- Mock server
https://developer.cdq.com/_mock/apis/transformation-api/v1/api-v1/datatransformationdefinitions/{id}/transform
- Production
https://api.cdq.com/transformation/rest/datatransformationdefinitions/{id}/transform
- cURL
- Java
- JavaScript
- Python
- Node.js
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"
}'
Response
application/json
{ "resultJson": [ {} ] }
Bodyapplication/json
Set to 'true' if you want to apply the reverse mapping
Default false
Example: "true"
ID of Json validation schema
Example: "66432427ba96dd27add2ea34"
- Mock server
https://developer.cdq.com/_mock/apis/transformation-api/v1/api-v1/datatransformationdefinitions/transform
- Production
https://api.cdq.com/transformation/rest/datatransformationdefinitions/transform
- cURL
- Java
- JavaScript
- Python
- Node.js
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"
}
]
}
}'
Response
application/json
{ "resultJson": [ {} ] }