Integrate fast and easy with the API gateway!

An API integration… How does this exactly work? And how do applications of different data formats communicate with each other? Read Leo’s blog in which he explains the topic API management and shows how this works in eMagiz.

In this blog

API management is aimed at a simple and secure way of managing how APIs (Application Programming Interface) are used internally and externally. API management concerns a broad focus on APIs and not only sees APIs as a technology, but also as a product that needs to be managed and that has a lifecycle.

There are always requirements for APIs. It has to be possible to find and access an API in an IT landscape, you have to be able to test with representative data, it has to be determined who has access to this data and it must be possible to monitor the use of the API. The designed functionality gives the organization control over the data driven services they offer to their customers. Through this, the organization can get insights into the behavior of customers and into the use of the offered services. The management of APIs is very important to determine the success of your digital applications and services.

As described above, APIs and API management consists of many processes and aspects. In this blog we focus on the “integration” aspect of API management and we discuss the transformation of data through an API gateway. Transformation of data is important, because IT-landscapes are becoming more fragmented. This leads to integration questions, where applications often don’t have the same data formats or definitions. Transformation possibilities are then required to integrate applications with each other.

Data transformation using a data model

eMagiz offers an API gateway within her hybrid integration platform. Through the API gateway, it’s possible to easily set up Open API Specification based endpoints and support integration scenarios. The eMagiz API gateway supports both ‘Passthrough’ as ‘Transformation’ type scenarios. Passthrough scenarios are situations in which the endpoints are directly coupled to each another and no transformation process is further required. In a transformation type scenario, there is a transformation of data on content, protocol or format level needed in order to connect the endpoints.

To facilitate the transformations, eMagiz often uses a Canonical Data Model (CDM). The CDM is a central data model in which all applied entities and attributes come together. By using the CDM it is easier to set up the transformations to multiple applications and it makes maintaining integrations easier.

Within eMagiz an API integration is structured as follows: An API gateway can receive a request, which contains data in a certain data structure (payload), and then offer it, transformed or not, to other systems that expect a different data structure.

The integration takes care of the conversion of the structure and validates the content and structure so it corresponds to the expectation of the receiving system. This process is repeated when the receiving system responds to the presented data. This response is transformed into the desired structure, so that it can be received correctly and the integration is complete.

To be able to perform all kinds of transformations, the platform uses data-related integration components, with which transformation flows can be configured within the platformclick here to see all transformation components) Common components that are used in a transformation are:

  • JSON to XML – Transformation of a request or response body from JSON to XML.
  • XML to JSON – Transformation of a request or response body from XML to JSON.
  • String manipulation – Find and replace parts of a string in the request and response.
  • Mask URLs in the content – Rewrite links in the response body, so that these lead back to a similar link within the API Gateway.
  • Backend service – Adapt from backend service for each incoming request.
  • Set body – Consistent message in body for both incoming as outgoing requests.
  • Set HTTP header – Add value to an existing header or add a new header for both request as response.
  • Set query string parameter – Add, replace or delete a request query string parameter.
  • Rewrite URL – Convert a request URL on behalf of an expected structure for a specific web service.
  • Transformation XML using XSLT – Use a XSL to XML transformation in both request as response body.

An example:

To show the value and use of a transformation with the API gateway within your landscape, we outline a use case below.The use case concerns obtaining JSON format data from external users and forwarding this data to other internal systems within the landscape. These internal systems require an XML format message.

To integrate data using the API gateway, a system has to register an endpoint within the API gateway. In this case, the endpoint is a POST operation. This operation is set up restful, this means that the data is sent and received in a JSON format.

In the eMagiz low-code flow editor, you can see data flows coming in through the POST endpoint (eg. POST/orders). After the data is received, it is transformed into XML, after which it is converted into a new request structure by means of a mapping, so that the SOAP service can be called. The response is then given in XML, after which a second transformation is used to convert the XML back to JSON.

So users send JSON and get a JSON response, but the integration landscape receives JSON and converts this into the other desired structure (XML in this case), it validates the structure with the target system and puts it through to the target system. Using the mapping and corresponding transformation tool, it is possible to successfully deliver data to every system in your digital landscape.

The illustrated use-case is also applicable for legacy systems such as AS400, where it is possible to receive messages in JSON format and convert them into the desired XML-structure. These messages are then presented to the AS400 system using an applicable system connector, the system returns an XML message and this XML structure is then converted back to a JSON format and the structure that the API user expects. Such transformations can be set up for different formats or protocols, including oData, grpc, rest and soap.

In short, the eMagiz iPaaS platform offers an extensive toolbox to shape transformations within your own digital landscape. The platform is able to transform data at various moments within your process and/or supply chain, both in batch and in real-time. By using hybrid scenarios, in which an API gateway can be combined with event streaming and message bus functionality, it is always possible to access data and transform it into the correct format. This allows users to quickly and easily implement integrations and derive value from their data.

Do you want to know how an API gateway can provide value to your integration landscape, or would you like to know some more about hybrid solutions, please contact us or send me a message on LinkedIn.

By Leo Bekhuis, Software Engineer @ eMagiz

Twitter
LinkedIn
WhatsApp
Email
en_GB