Get the external function swagger for mapping file

get

https://{FusionAppsHost}/crmRestApi/atcProductCatalog/11.13.18.05/productCatalogManagement/v1/swagger/ExternalFunctionSwagger

Request

There are no request parameters for this operation.

There's no request body for this operation.

Back to Top

Response

Supported Media Types

200 Response

OK
Body ()
Root Schema : schema
Type: object

400 Response

Your request couldn't be processed because it contains missing or invalid information, such as a validation error on an input field, a missing required value, and so forth.
Body ()
Root Schema : Error
Type: object
Title: Error
Show Source

401 Response

Your request isn't authorized. The authentication credentials included with this request are missing or invalid.
Body ()
Root Schema : Error
Type: object
Title: Error
Show Source

404 Response

Your request includes a resource URI that doesn't exist.
Body ()
Root Schema : Error
Type: object
Title: Error
Show Source

405 Response

HTTP action specified in the request (DELETE, GET, POST, PUT) isn't supported for this request URI.
Body ()
Root Schema : Error
Type: object
Title: Error
Show Source

500 Response

The server encountered something unexpected that prevented it from completing the request.
Body ()
Root Schema : Error
Type: object
Title: Error
Show Source
Back to Top

Examples

The following example shows how to get the external function swagger for mapping file by submitting a get request on the REST resource using cURL.

cURL Command

curl -u username:password -X GET https://{FusionAppsHost}/crmRestApi/atcProductCatalog/11.13.18.05/productCatalogManagement/v1/swagger/ExternalFunctionSwagger -H 'Content-Type: application/json' | json_pp

Example of Response Body

The following shows an example of the response body in JSON format.

{
    "openapi": "3.0.0",
    "info": {
        "title": "External Mapping Function API for integration",
        "version": "1.0.0",
        "description": "**This API allows you to implement external mapping function used for either transformation\n or pre-transformation declared inside mapping file, the external function can be written in any language and anywhere\n  reachable over network from fabric.**\n",
        "x-summary": "API for execution of external mapping function"
    },
    "servers": [
        {
            "url": "https://{ExternalServerHost}/api/apiIntegration/v1",
            "description": "External API integration Mapping Function server"
        }
    ],
    "tags": [
        {
            "name": "Transform",
            "description": "custom mapping related to transformation"
        },
        {
            "name": "PreTransform",
            "description": "custom logic related to preparation of transformation input"
        }
    ],
    "security": [
        {
            "OAuth2": [
                "read:extmappingfunc"
            ]
        }
    ],
    "paths": {
        "/transform": {
            "post": {
                "summary": "Transform the input JSON based on the provided function and schema.",
                "tags": [
                    "Transform"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TransformRequest"
                            },
                            "examples": {
                                "example1": {
                                    "summary": "Example request for Transform , product name will be concatenated with paramList passed in order\"",
                                    "value": {
                                        "functionName": "mergeProductsInSingleArray",
                                        "inputJson": "{ \"Product1\": \"{\"product_name\":\"I Phone\"}, \"Product2\": {\"product_name\":\"SAMSUNG s24 AI\"}}",
                                        "paramList": [
                                            "ID-123",
                                            "ID-456"
                                        ],
                                        "contextParameters": [
                                            {
                                                "Name": "JobId",
                                                "Value": "1234"
                                            }
                                        ]
                                    }
                                },
                                "example2": {
                                    "summary": "Example request for full component transformation",
                                    "value": {
                                        "functionName": "transformSiebelProduct",
                                        "inputJson": "{ \"Product1\": \"{\"product_name\":\"I Phone\"}, \"Product2\": {\"product_name\":\"SAMSUNG s24 AI\"}}",
                                        "paramList": [
                                            "ID-123",
                                            "ID-456"
                                        ],
                                        "contextParameters": [
                                            {
                                                "Name": "JobId",
                                                "Value": "1234"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful response containing the transformation result.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TransformResponse"
                                },
                                "examples": {
                                    "example1": {
                                        "summary": "Example 1 returning a string",
                                        "value": {
                                            "result": {
                                                "valueType": "string",
                                                "value": "I Phone-ID-123"
                                            }
                                        }
                                    },
                                    "example2": {
                                        "summary": "Example 2 returning a number",
                                        "value": {
                                            "result": {
                                                "valueType": "number",
                                                "value": 12.22
                                            }
                                        }
                                    },
                                    "example3": {
                                        "summary": "Example 3 returning a integer",
                                        "value": {
                                            "result": {
                                                "valueType": "integer",
                                                "value": 12
                                            }
                                        }
                                    },
                                    "example4": {
                                        "summary": "Example 4 returning an empty object",
                                        "value": {
                                            "result": {
                                                "valueType": "object",
                                                "value": {}
                                            }
                                        }
                                    },
                                    "example5": {
                                        "summary": "Example 5 returning an empty array",
                                        "value": {
                                            "result": {
                                                "valueType": "array",
                                                "value": []
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "500": {
                        "$ref": "#/components/responses/InternalServerError"
                    },
                    "503": {
                        "$ref": "#/components/responses/ServiceUnavailable"
                    }
                }
            }
        },
        "/preTransform": {
            "post": {
                "summary": "Preparation for the transformation input based on the provided function and parameters.",
                "tags": [
                    "PreTransform"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PreTransformRequest"
                            },
                            "examples": {
                                "example1": {
                                    "summary": "Example request for preTransform merge two product in single array and include price passed as parameters\"",
                                    "value": {
                                        "functionName": "mergeProductsInSingleArray",
                                        "inputJson": "{ \"Product1\": \"{\"product_name\":\"I Phone\"}, \"Product2\": {\"product_name\":\"SAMSUNG s24 AI\"}}",
                                        "paramList": [
                                            "$2000",
                                            "$4000"
                                        ],
                                        "contextParameters": [
                                            {
                                                "Name": "JobId",
                                                "Value": "1234"
                                            }
                                        ]
                                    }
                                },
                                "example2": {
                                    "summary": "Example request for preTransform to remove a product with product type as Device\"",
                                    "value": {
                                        "functionName": "removeProductsInSingleArray",
                                        "inputJson": "{ \"Product1\": \"{\"product_name\":\"I Phone\", \"product_type\":\"Device\"}, \"Product2\": {\"product_name\":\"SAMSUNG s24 AI\", \"product_type\":\"Service\"}}",
                                        "contextParameters": [
                                            {
                                                "Name": "JobId",
                                                "Value": "1234"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful response containing the data that can be used for transformation in the subsequent processing",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TransformResponse"
                                },
                                "examples": {
                                    "example1": {
                                        "summary": "Example 1 returning a json string",
                                        "value": {
                                            "result": {
                                                "valueType": "string",
                                                "value": "{\"products\":[{\"product_name\":\"I Phone\",\"product_price\":\"$2000\"},{\"product_name\":\"SAMSUNG s24 AI\",\"product_price\":\"$3000\"}]}"
                                            }
                                        }
                                    },
                                    "example2": {
                                        "summary": "Example 2 returning an empty object",
                                        "value": {
                                            "result": {
                                                "valueType": "object",
                                                "value": {}
                                            }
                                        }
                                    },
                                    "example3": {
                                        "summary": "Example 3 returning an empty array",
                                        "value": {
                                            "result": {
                                                "valueType": "array",
                                                "value": []
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "500": {
                        "$ref": "#/components/responses/InternalServerError"
                    },
                    "503": {
                        "$ref": "#/components/responses/ServiceUnavailable"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "OAuth2": {
                "type": "oauth2",
                "flows": {
                    "authorizationCode": {
                        "authorizationUrl": "https://example.com/oauth/authorize",
                        "tokenUrl": "https://example.com/oauth/token",
                        "scopes": {
                            "read:extmappingfunc": "External mapping function"
                        }
                    }
                },
                "description": "OAuth 2.0 authentication."
            }
        },
        "schemas": {
            "TransformRequest": {
                "type": "object",
                "description": "The structure of the request for the transformation related external mapping function",
                "properties": {
                    "functionName": {
                        "type": "string",
                        "description": "The name of the function to apply.",
                        "example": "transformFunction"
                    },
                    "inputJson": {
                        "type": "string",
                        "description": "The JSON input to be used for transformation",
                        "example": "{\"product_name\":\"I Phone\"}"
                    },
                    "paramList": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "Optional parameters for the function."
                    },
                    "contextParameters": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "Name": {
                                    "type": "string",
                                    "example": "JobId"
                                },
                                "Value": {
                                    "type": "string",
                                    "example": "1234"
                                }
                            }
                        }
                    }
                },
                "required": [
                    "functionName",
                    "inputJson"
                ]
            },
            "TransformResponse": {
                "type": "object",
                "description": "The structure of the response expected from external mapping function related to transformation",
                "properties": {
                    "result": {
                        "type": "object",
                        "description": "The result object of the transformation function, if any.",
                        "properties": {
                            "valueType": {
                                "type": "string",
                                "description": "The type of value field defined in result",
                                "default": "string",
                                "enum": [
                                    "object",
                                    "array",
                                    "string",
                                    "integer",
                                    "number",
                                    "boolean"
                                ]
                            },
                            "value": {
                                "description": "this can be either an object or an array or basic data type.",
                                "oneOf": [
                                    {
                                        "type": "object"
                                    },
                                    {
                                        "type": "array"
                                    },
                                    {
                                        "type": "string"
                                    },
                                    {
                                        "type": "integer"
                                    },
                                    {
                                        "type": "number"
                                    },
                                    {
                                        "type": "boolean"
                                    }
                                ]
                            }
                        }
                    }
                }
            },
            "PreTransformRequest": {
                "type": "object",
                "description": "The structure of the request for the pre-transformation related to external mapping function",
                "properties": {
                    "functionName": {
                        "type": "string",
                        "description": "The name of the function to apply.",
                        "example": "preTransformFunction"
                    },
                    "inputJson": {
                        "type": "string",
                        "description": "The JSON input for preTransformation",
                        "example": "{\"product_name\":\"I Phone\"}"
                    },
                    "paramList": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "Optional parameters for the function."
                    },
                    "contextParameters": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "Name": {
                                    "type": "string",
                                    "example": "JobId"
                                },
                                "Value": {
                                    "type": "string",
                                    "example": "1234"
                                }
                            }
                        }
                    }
                },
                "required": [
                    "functionName",
                    "inputJson"
                ]
            },
            "PreTransformResponse": {
                "type": "object",
                "description": "The structure of the response expected from external mapping function related to pre-transformation",
                "properties": {
                    "result": {
                        "type": "object",
                        "description": "Success - The preTransform Function executed successfully and returned result\"",
                        "properties": {
                            "valueType": {
                                "type": "string",
                                "enum": [
                                    "object",
                                    "array",
                                    "string"
                                ]
                            },
                            "value": {
                                "description": "this can be either an object or an array or a json string",
                                "oneOf": [
                                    {
                                        "type": "object"
                                    },
                                    {
                                        "type": "array"
                                    },
                                    {
                                        "type": "string"
                                    }
                                ]
                            }
                        }
                    }
                }
            },
            "Error": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "string",
                        "description": "Application-related code (as defined in the API or from a common list).",
                        "example": "API Integration External Function execution Error"
                    },
                    "reason": {
                        "type": "string",
                        "description": "Text that explains the reason for the error. This can be shown to a client user.",
                        "example": "Invalid request parameters"
                    },
                    "message": {
                        "type": "string",
                        "description": "Text that provides more details and corrective actions related to the error. This can be shown to a client user.",
                        "example": "The provided request parameters are invalid. Please check the documentation for the correct format."
                    },
                    "status": {
                        "type": "string",
                        "description": "HTTP error code extension like 400-2.",
                        "example": "400-2"
                    }
                },
                "required": [
                    "code",
                    "reason"
                ]
            }
        },
        "responses": {
            "BadRequest": {
                "description": "Bad Request - The request could not be understood by the server due to malformed syntax.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Unauthorized": {
                "description": "Unauthorized - Authentication is required and has failed or has not yet been provided.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Forbidden": {
                "description": "Forbidden - The server understood the request, but it refuses to authorize it.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "NotFound": {
                "description": "Not Found - The server cannot find the requested resource.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "InternalServerError": {
                "description": "Internal Server Error - The server encountered an unexpected condition that prevented it from fulfilling the request.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "ServiceUnavailable": {
                "description": "Service Unavailable - The server is currently unable to handle the request due to temporary overload or scheduled maintenance.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            }
        }
    }
}
Back to Top