Thanks again, Steve. We are not going to customize the API now. We will be simply adding additional where clause (1=2) to the existing where clause. Whatever custom requirements we have, we will plan for a separate solution.
Original Message:
Sent: Thu November 14, 2024 09:49 AM
From: Steven Shull
Subject: WHOAMI API customization
Again, OOTB, we use this relationship in one place and only one place which is the whoami request. The whoami already supports no records being returned because the first time you login it will return no records.
Extending whoami should not be done. You risk breaking critical Maximo processes even if it doesn't slow down performance. Make a separate API request. If you absolutely need everything to be returned in a single request, build your own API that takes the response we build & adds in what you need.
------------------------------
Steven Shull
Original Message:
Sent: Thu November 14, 2024 09:35 AM
From: Suhas Joshi
Subject: WHOAMI API customization
Thanks Steven,
That's exactly what we were planning to do but were unaware if it will have any negative impact on out of the box functionalities. If we add 1=2 in the existing query, will it have any issues in any out of the box functionalities? I mean, if there are no records returned by the relationship, will it give any null pointer error anywhere in OOB classes? Is it safe to change this where clause if OOB will still work post this change? For custom changes, we will take care by changing the design.
------------------------------
Suhas Joshi
Original Message:
Sent: Thu November 14, 2024 09:14 AM
From: Steven Shull
Subject: WHOAMI API customization
No, the issue was fixed after 7.6.1.2 had stopped receiving updates. The fix is to stop returning the data so you could add 1=2 to the relationship to avoid the performance issue if you're not using the query for something else (we only use it out of the box for this purpose). On the MAXUSER object in Database Configuration, modify the LOGOUTTRACKING relationship and add "1=2 and" at the beginning. For example:
1=2 and userid = :userid and attemptresult in (select value from synonymdomain where domainid='ATTEMPTRESULT' and maxvalue in ('LOGOUT','TIMEOUT','SYSLOGOUT')) order by attemptdate desc
------------------------------
Steven Shull
Original Message:
Sent: Thu November 14, 2024 09:06 AM
From: Suhas Joshi
Subject: WHOAMI API customization
Thanks everyone for the quick response. It has given lot of insights into this API.
Steven, the system property you are talking about, which one is it and is it available in 7.6.1.2? We are also having issues with lastlogout query coming from whoami.
------------------------------
Suhas Joshi
Original Message:
Sent: Thu November 14, 2024 08:51 AM
From: Steven Shull
Subject: WHOAMI API customization
Adding to the previous responses from Sangaiah & Jason, I wanted to describe the purpose of the whoami request and why adding additional objects is a bad idea. The purpose of the whoami request was to provide the most important data about the user (like default insert site, name, email, etc.) without needing to fetch data using the Mbos. The majority of the data comes from the UserInfo class which maintains a cache of that data. The entire JSON body is built in the UserInfo class.
Over time, this has continued to get more things added to it out of the box. One of those was the last logout date for the user. This caused a performance issue in some customer environments which negatively impacted processes that depend on the API request (like Maximo Mobile). We had customers where the whoami was taking 1+ minutes and the timeout of the request was set to 30 seconds so we couldn't get any of the data we need. In more recent versions we have a system property to control this and disable it by default. After the change the API request was taking <1 second.
It's better to make a separate request to fetch the additional data, or build a specialized message like Jason mentioned using automation scripts, that handle your specific required scenario for your product. That way you don't impact core processes that won't need that data.
------------------------------
Steven Shull
Original Message:
Sent: Wed November 13, 2024 12:13 AM
From: Suhas Joshi
Subject: WHOAMI API customization
Hi,
Few questions I have around Maximo's OOB whoami API.
- Where is this API registered and where can I see the details of it?
- Is there a way we can customize this API like adding additional objects in the response?
#IBMMaximo
#IBMMaximoAssetManagement
------------------------------
Suhas Joshi
------------------------------