Maximo Endpoint is used for outbound integration. When we trigger integration in Maximo, publish channel with associated object structure create a message and store it in an outbound queue. Cron task for the outbound queue invokes the endpoint which routes outbound message to an external system.
There is a number of different types of endpoints to cover a number of different external systems, such as Flat File Handler, XML Handler (JSON) , HTTP handler, Web Service Handler etc.
The message will be stored as a flat file, XML or JSON file, placed into custom interface table, or sent to predefined URL using HTTP or HTTPS protocols. In some cases, however, functionality does not meet the requirements and our only choice is customization.The purpose of this blog is to exhibit an example of custom endpoint used in integration with external systems that are using Token Functionality.
Custom HTTP Handler for token retrieval
Some external systems require use of token functionality, which entails logging into an external system using username/password and then retrieving the token. After token retrieval, another request delivers the actual message. Due to the nature of integration, Maximo can invoke only one request. We will examine ways to pack two requests into one.
The example used for the purposes of this blog is integration between IBM Maximo and Zinier Mobile Platform. The integration uses REST API on both sides and all messages are in json format.
What is Zinier?
Zinier is an intelligent field service automation platform that helps organizations with complex processes transform their field service operations with AI-driven recommendations.
BPD Zenith and Zinier have collaborated to provide clients with an all-in-one mobile experience to supercharge every aspect of an organization’s field service operation from the back office to the field.
The process:
Zinier require access to its REST service by token instead of username and password, but before that we must retrieve token using username and password.
We will need two endpoints: ZINLOGIN and ZININSERTWO.
ZINLOGIN endpoint uses standard HTTP handler and the response is in JSON format. Username and password are provided, and token is retrieved.
ZININSERTWO endpoint is using custom handler. Let us call it ZINIER. The goal of this customization is to reuse token supplied in first endpoint.
We will create new handler class:
Handler will have one additional parameter added through class for endpoint that is fetching token:
Headers parameter will have arbitrary default value for token.
In the class, we will create method getToken(), which is retrieving token using endpoint ‘ZINLOGIN’.
This method will be used in invoke(…) method of the class.
Later, we will have to place token value into header by replacing default value:
And that is all. Let’s recap:
- Publish channel will have defined endpoint ZININSERTWO.
- When end point is triggered it will first invoke login end point defined as a parameter.
- Login end point will retrieve token.
- During initialization of end point default token in HEADERS parameter will be replaced with fetched token.
- Call will proceed with accurate token.
This is a simple and very useful way of integrating with an external system that is utilizing Token functionality and demand for it is significantly high. Until IBM creates this handler in OOB Maximo environment, this is a workaround for all of you Maximo enthusiasts out there. If you’d like to learn more about Maximo integration or have any questions regarding the contents of this blog, please contact BPD Zenith.