Get the external function swagger for mapping file
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 TopResponse
- application/json
200 Response
object400 Response
objectError-
@schemaLocation: string
it provides a link to the schema describing a REST resource.
-
@type: string
The class type of a REST resource.
-
code(required): string
Application related code (as defined in the API or from a common list)
-
message: string
Text that provide more details and corrective actions related to the error. This can be shown to a client user.
-
reason(required): string
Text that explains the reason for error. This can be shown to a client user.
-
referenceError: string
url pointing to documentation describing the error
-
status: string
http error code extension like 400-2
401 Response
objectError-
@schemaLocation: string
it provides a link to the schema describing a REST resource.
-
@type: string
The class type of a REST resource.
-
code(required): string
Application related code (as defined in the API or from a common list)
-
message: string
Text that provide more details and corrective actions related to the error. This can be shown to a client user.
-
reason(required): string
Text that explains the reason for error. This can be shown to a client user.
-
referenceError: string
url pointing to documentation describing the error
-
status: string
http error code extension like 400-2
404 Response
objectError-
@schemaLocation: string
it provides a link to the schema describing a REST resource.
-
@type: string
The class type of a REST resource.
-
code(required): string
Application related code (as defined in the API or from a common list)
-
message: string
Text that provide more details and corrective actions related to the error. This can be shown to a client user.
-
reason(required): string
Text that explains the reason for error. This can be shown to a client user.
-
referenceError: string
url pointing to documentation describing the error
-
status: string
http error code extension like 400-2
405 Response
objectError-
@schemaLocation: string
it provides a link to the schema describing a REST resource.
-
@type: string
The class type of a REST resource.
-
code(required): string
Application related code (as defined in the API or from a common list)
-
message: string
Text that provide more details and corrective actions related to the error. This can be shown to a client user.
-
reason(required): string
Text that explains the reason for error. This can be shown to a client user.
-
referenceError: string
url pointing to documentation describing the error
-
status: string
http error code extension like 400-2
500 Response
objectError-
@schemaLocation: string
it provides a link to the schema describing a REST resource.
-
@type: string
The class type of a REST resource.
-
code(required): string
Application related code (as defined in the API or from a common list)
-
message: string
Text that provide more details and corrective actions related to the error. This can be shown to a client user.
-
reason(required): string
Text that explains the reason for error. This can be shown to a client user.
-
referenceError: string
url pointing to documentation describing the error
-
status: string
http error code extension like 400-2
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"
}
}
}
}
}
}
}