THE BPD Blog

From blogs to case studies to news, we love sharing our tips and tricks for asset management, cloud, IoT and smarter operations.

by | Jun 23, 2022

Developing Custom Mobile App using Maximo REST API

The mobile app for Maximo operations is a gateway to IoT and Advanced Analytics by capturing precise data at the point of performance and data not being captured when using the desktop version of Maximo. As assets become smarter and existing businesses need more efficiency, it is natural to lean on mobile platforms for better asset management.

The new REST APIs for IBM® Maximo® Asset Management are a rewrite of the existing REST APIs that were released after Maximo Asset Management version 7.1, and are integrated into Maximo Asset Management releases starting with version 7.6.0.2. The new REST APIs are sometimes referred to as the REST/JSON APIs because of the end-to-end support for JSON data format.

Maximo REST API makes it easier for software developers, especially mobile application developers. The back-end system from Maximo is sufficient to meet the needs of making mobile applications. Of course, not only mobile apps but desktop apps and website apps can also be developed, but this time we will focus on mobile development.

For more details on the API, refer to the documentation here.

1. Prepare REST API Library.


Before starting the development of the Mobile App, the developers may need to configure their API Library and can do the integration test through it. Several applications can be utilized for this like Postman, Swagger, REST Client VSCODE, etc. For the current topic we will setup for:

a. Get API key

Request Configuration :

host: https://host/maximo/oslc/

maxadmin : base64encode(username:password)

Positive result:

If the login is successful, it will have a response body for the API key. API keys are created for a given Maximo user and the API calls made using that API key effectively works in the context of the said user. This implies all the user’s permissions are respected in that API call. REST APIs invoked using API keys use “silent” login. This implies that there are no MAXSESSION entries created. By default, there would not be any server-side web sessions. This implies that clients using REST APIs with API keys, do not need to call the /logout API as there is no persistent server-side session. API keys can be created and revoked as needed. There is only one API key per user allowed at this point. Each of these API keys may have an expiry (in minutes). The expiry time is specified at the time of creation. An expiry time of -1 implies the key will never expire. The only way to invalidate the key would be to revoke it manually. Below we list the REST APIs that can be used to create/revoke the API keys.

Negative Result:

A negative response will be handled by Maximo, the developers only need to capture what message is causing the login to fail.

b. Revoke API key

Request Configuration :

Positive result:
Response Status Code: 200

If the response status code from the request is 200 that means the API key is revoked and can no longer be used to make further API requests.

c. Profile

Request configuration:

As you can see, now we use API key header and the value is coming from the previous request. The benefit of using this API key is that we don’t disclose the username and password of the Maximo user, instead of that we just share a token that cannot be decrypted and it can be expired within the time that we setup during the API key creation.

Result

 

Whoami is an out-of-the-box REST API function from Maximo, and the purpose of that is to get the detailed data of current user login whether it using maxauth or apikey.

d. Result Set 

The REST APIs have tight integration with the automation scripts. Automation scripts can be used to develop custom APIs. The following example call describes how automation scripts interact with REST APIs. To find the total number of work that is in progress and service requests on a given site, you need to create an API since there is no out-of-the-box API for this task. Since this is a REST API with a JSON response, you can use the JavaScript language for scripting. You call this API countofwoandsr.

Automation Script

Script name: countofwoandsr

Language: Javascript

Request configuration

Here you can specify the site id on the parameter, or you can adjust any parameters based on your code requirement.

Result

e. Workorder List

Object structure

For workorder data in Maximo REST API you need to prepare the object structure, Go To Integration > Object Structure.
Create New Object Structure, and choose the parent object as WORKORDER.

Request configuration

From the request we can use select, where or limit the number of records that need to be fetched.

Result

Voila! We’ve successfully set up and tested the REST API Library which we will use for our mobile development. Next, let’s jump into the main part!.

 

2. Flutter Cross Platform.


Flutter is an open-source framework by Google for building beautiful, natively compiled, multi-platform applications from a single codebase. On this topic, we will be using flutter for Mobile framework development.

a. Login and Profile

In Flutter we can configure one function to call two requests sequentially. Under this login function first, we call the request to get the apikey value and check if the API key generation is successfully made.  If yes, then pass the apikey value for the next request for calling the whoami REST API function.

b. Logout

This request is to revoke the API key by calling the apitoken/revoke, and after that, we check the response status code.

c. Result Set

This function will be used to get the number of workorder based on status and status date. In this function, we call getToken first to retrieve the apikey value. If the value exists then we can continue the request if not then it will throw a message error and redirect to the login page.

d. Workorder List

This function is for getting the detailed workorder data and it will be fetched under the workorder list of the mobile app.

3. Mobile App

a. Login

In this figure, we can see the login user interface, and it requires a username and password. Here we can also set the configuration like the hostname and port if we want to easily move between the Maximo environment. From the login button, the request for calling the API key request and then whoami request will be made. And if successful, it will redirect to the Dashboard page of the mobile app.

b. Dashboard

In this figure, we can see the dashboard of the mobile app after the user successfully enter the correct username and password the user will be directed from login to the dashboard page. From this page we can see the result set of workorder data, this result set also can be filtered by clicking the date range button and selecting the date of workorder that you want to fetch.

c. Workorder

Workorder card list

In this figure, we can see the workorder page by clicking the paper icon under the bottom tab. And by clicking the refresh button it will call the workorder API request and if it is successful, it will retrieve the workorder data under this card list.

d. Profile and logout

To assist with the logout process

In this figure, we can see the profile of the user who login into the mobile app. Here only the display name, organization and site will be retrieved for the user information. For the current session Update Profile and Change Password are not developed yet, but of course, for the logout button, it will work since we have prepared the function to call the revocation of the spiky, if the logout button is clicked and it will redirect the user to the login page.

In this session we only discuss simple mobile applications, there are many more that can be explored and developed depending on the requirements needed. This is just to open our eyes, especially for all mobile developers to think about this because now and near future there will be a lot of needs for the EAM App in the mobile version which is of course more customized.

Don’t forget to share it and hope this little information can be useful for all who read it.  If you need further help with Maximo or Mobile Solutions, please don’t hesitate to contact us here.

 

Bagas Burman

Bagas Burman

0 Comments

Submit a Comment

Your email address will not be published.

Resourcing for Success

Resourcing for Success

Project resourcing is frequently one of the hot topics in our meetings. I frequently receive questions such as: Can we start the project now? Can we commit this resource to deliver from start to finish? Can we upskill one of our techs? Can we provide an additional...

Maximo Mobile Review

Maximo Mobile Review

The Maximo Mobile app recently released by IBM is something to get excited about!  IBM's Maximo mobility journey has been a little checkered in the past – previous solutions (Everyplace and Anywhere) didn't quite meet all the needs and requirements of many...

Asset Management for Net-Zero Futures

Asset Management for Net-Zero Futures

Sustainability is not a new concept and BPD Zenith have always strived to be socially responsible, however, it is a critical imperative for today’s business operations – and for the planet. There has been a shift from using digital to improve the bottom line, to...

The Hidden Value of CMMS Master Data

The Hidden Value of CMMS Master Data

Having made a significant investment in your CMMS, advances in Data analytics are prompting rethinks about the Master Data that underpins your ability to launch programs such as Asset performance management, Monitor Asset health and enhance Predictive Maintenance. A...

BPD in Offshore Wind: When the wind blows, our assets perform…

BPD in Offshore Wind: When the wind blows, our assets perform…

London Array Limited (LAL) maintain a critical electricity production wind farm in the Outer Thames Estuary.   Lucy Horner (then Maintenance Strategy Engineer) joined the AiTalks podcast last year to discuss her world of offshore wind provision, the levels of...

Sign up to our free newsletter to explore emerging technologies, industry events and Maximo best practice.

Discover the Maximo Application Suite

Discover BPD's award winning Maximo and IoT Services

Come with BPD Zenith to the future of Asset Management

Partner Ecosystem

BPD Zenith partners with a diverse array of the world’s top Technology, Business and Solution Integration leaders.