Adding APIs in the Infor OS API Gateway
Overview
This tutorial will guide you through integrating an API with an API Gateway using Infor OS. You’ll discover the essence of an API Gateway, its importance, and the steps to set one up using Infor OS. You’ll also learn how to test it effectively. When we ask what an API Gateway is, we’re referring to a crucial Software System. It acts as a reverse proxy, forming a bridge between API consumers, like web and mobile applications, and providers, including Infor and other external services.
Requirements
- Access to ION API Gateway
- Security role: IONAPI-Administrator
- Security role: IONAPI-User
- Infor U courses.
Tutorial
Difficulty: Medium
Estimated completion time: 30 Minutes
This tutorial will focus on using the role of an API Gateway. It functions as a strong intermediary, guaranteeing secure and efficient communication between consumers and providers. A unified access point simplifies everything for developers and their applications by providing a single base URL path for easier API access. Streamline security enhances protection by creating a uniform authentication process, which ensures that all API interactions are secure and only authorized requests get through. Enhanced API capabilities mean the gateway boosts your API with additional features without altering the existing server or code.
This includes analyzing performance, logging usage patterns, and conducting thorough searches of those logs. It also includes adding and configuring an API.
Let’s examine how to incorporate an API into the gateway. Login to the Infor OS Portal, select the API Gateway tab at the top of the page.
The Available APIs are in the navigation menu in the upper left corner. Clicking this will take you to the menu where all the accessible APIs are listed.
Introduce a new API, and hit the + Add button.
You’ll see two options.
NOTE: You can create an API from the ground up or choose from a selection of templates. The templates cover popular ION applications and third-party services like AWS, Twitter, and others, allowing you to set up quickly.
We will develop an API from the ground up, particularly one not offered among the templates. We’ll proceed by clicking the Create New button.
Please fill in the required fields. Application name: Neutrino API. In this scenario, we’ll utilize a third-party API from Neutrino, which you can find online. https://neutrinoapi.com/
NOTE: Neutrino offers a variety of General web application APIs for the API context.
Assign a version number, V2, for this example.
Moving on to the Suite Name and label it Neutrino API. Enter a description, General Web API.
Next, select an icon. You can either upload a custom one or pick from a selection already provided.
Define at least one target endpoint; this step is crucial to inform the API Gateway about the actual destination API URL. Click the + sign in the Target Endpoint section to input the proxy endpoint, which Neutrino, the vendor, has provided.
In the Target Endpoint URL field enter https://neutrinoapi.com/
Add a Description of Neutrinoapi Main URL and the in the Proxy Context field. We’ll use APIS.
NOTE: It is important to know that this will become a component of the public-facing proxy endpoint URL that Infor OS constructs for us. This URL comprises a few distinct elements. The tenant name, then the repository for all our custom APIs. Next is the API context we specified earlier and finally the proxy context.
Together, these components form the complete URL. This becomes the endpoint we’ll give to developers, signaling them to use this URL to hit the API in our Gateway for accessing the services.
In the Proxy Security field, there are two primary options for accessing the services. OAuth 2.0 is the default standard for securing that URL, anonymous access is also available but generally reserved for testing phases. Select OAuth 2.0.
NOTE: The Target Endpoint Security must match what the Neutrino web service specifies.
According to Neutrino’s documentation, they require a critical API method for security. The API Gateway supports various security methods, including ones used by AWS and Google.
Neutrino opts for a widely used approach known as the API key method, necessitating the input of specific keys for Neutrino. From the drop-down, select the API Key option.
The first Key Name is identified as a user-id; enter the user account you generated on the Nuetrino website. The second Key Name is api-key. Enter the Root Key value associated with the Neutrino account.
Click Save.
Go back to the available API section, and under the Neutrino API Suite definition, you’ll see that everything has been configured and saved. The status is now set to active. Click on the Neutrino API widget
You will notice the Status indicator also marks the API as active.
The next step is to add some documentation. To do this, in the Neutrino API configuration, click on the API Documentation icon.
NOTE: Since this is a modern RESTFUL API, the API Gateway supports various documentation formats, with PDF being the default. However, opting for Swagger or an open API specification is a more Dynamic and Contemporary choice.
The vendor we’re collaborating with offers their API specific in JSON format.
Select the Documentation tab and click the + Button.
In the Name field type Main Specification. In the Type field select Swagger. In the Enter URL or Upload Swagger JASON/YAML field use https://www.neutrinoapi.com/api/openapi.json and click Save.
Notice that the API Suite has been updated.
Scrolling down, we observe that the API specifications have been rendered, allowing us to view all the available Services.
Navigating to the URL Info service. We can access detailed information about this specific API, including examples of making calls and what responses to expect. Click the Try It Out button.
Test by entering a URL such as https://www.google.com in the URL to probe field. Click Execute to query against that URL.
Now, with the credentials and the two keys we’ve entered, it’s retrieving live information directly from Neutrino and delivering a response in real-time. Receiving a 200 code is excellent news as it confirms a successful interaction and provides us with all the details about the URL.
This verifies that the API and its Suite have been successfully integrated and are now primed for use within the applications.
Exploring this functionality demonstrates the API Suite’s seamless integration and real-world application, ensuring it’s fully operational and accessible for our development needs.
Watch the following video to view all the steps that were covered.
Resources
Help Documents and User Guides