Should You API-Enable Your IBM i (AS/400)?
See how leveraging APIs can benefit IBM i users, and how you can integrate it to support the functionality that APIs offer.
Join the DZone community and get the full member experience.
Join For FreeOne of the most important trends in technology today is the rise of the “API economy,” which is allowing organizations to use Application Programming Interfaces (APIs) not only to access hidden data but to utilize information hidden in their systems to drive business value. There is an almost unlimited number of ways that APIs can be used – and they are an especially powerful tool for IBM i (previously known as AS/400) users who want to give themselves a competitive advantage.
APIs can be a great way to not only enable your IBM i or AS/400 (referred to collectively as just “IBM i” hereafter) applications to support functionality such as mobile applications, web applications and B to B functionality, but they also further extend and embed your IBM i investment in your company’s overall IT strategy. Leveraging APIs can enable your IBM i as a core resource in your company’s overall IT infrastructure and allow you to maintain your investment without a costly migration or rip-and-replace strategy. Additionally, you can monetize (or at the very least determine) an ROI on your API investment by enabling access to the APIs by third parties such as dealer networks, business partners, and end users to create value in their applications.
Why APIs?
If you’re an IBM i user, you should strongly consider leveraging APIs if you have customers or external users who need access to data, if you need to integrate your activities with your corporate website, or if you’re trying to promote mobile initiatives and support sales and service professionals.
Using a standard interface to access corporate assets not only reduces costs, but it also reduces complexity for the developer of the API and for the consumer of the API. Using an industry standard interface such as REST/JSON for the API layer creates a consistent way for consumers to use the API without requiring any knowledge of the IBM i or how the applications on the system work. This creates consistency within the organization for application development that is shareable and reusable among multiple constituents and follows modern development standards. Additionally, the development processes that have been put in place for the IBM i do not need to change, and IBM i developers can continue to develop applications in their languages of choice without having to change their development methods while ensuring they stay productive.
JSON Request Example
JSON Request Example
How to Do It
There are multiple ways to connect APIs to the back-end functionality on IBM i, and the best approach depends upon the need of the consumer and the need of the data to be processed via business logic. Below is an overview of some different ways you can connect APIs to your IBM i applications. These methods include screen integration, direct DB2 access, and using data queues, JT400 toolbox, or XML services to build callable programs. In a future article, we will dive into the details of using each method.
Need to Preserve and Use Existing Business Logic: Screen Integration
This method is the fastest way to repurpose your existing business logic when it needs to be applied to the data. Additionally, this method does not require any code changes to IBM i applications and allows you to continue to manage applications and their resource needs as you always have. Go this route if you need a solution that’s quickly-implementable, is nonintrusive, or that preserves business logic.
Data Access: Direct to DB2
This method is commonly used for access to data or updating data that does not need any additional business logic processing (for example, the need to update a customer’s address or to retrieve a list of products). However, if you are using stored procedures, business logic can be applied to the data as well. Some benefits of the data access approach include reduced overhead for data that does not need processing, consistent access via an API, and the ability to use stored procedures for processing data.
Callable Programs: Using Data Queues, JT400 Toolbox, or XML Service
These methods are great for removing the overhead associated with the interactive process on IBM i. However, they do require applications to support the interface or else they may need some modification to do so. The advantages of these methods are that they allow you to access data directly via the program, create new functions without having to build a new Green Screen UI, use XML and enable it to interact with REST and SOAP services that are easily shared.
The API Advantage
There are many reasons why you should API-enable your IBM i. The advantages of using an API approach include: a standard interface to corporate assets, consistency with newer application development and most importantly, no requirement to have advance knowledge of the host system by the API consumer. Furthermore, API-enablement does not affect how development is done on the IBM i. You will gain great flexibility in supporting the IT efforts of your company while keeping the IBM i at the center of your IT strategy.
Opinions expressed by DZone contributors are their own.
Comments