Maximo Open Forum

 View Only

 api/os rest call with or in the oslc.where clause is failing.

  • Integrations
Jose Nodeland's profile image
Jose Nodeland posted 09-19-2025 14:15

 Anyone have a working example doing a api/os rest call that includes an or in the oslc.where?   I'm converting some rest calls in Maximo 7.6.1.3 to use an apikey for authentication (in preparation to move to MAS), and need to do an or condition.

I cannot get this sample to work.
https://myserver/maximo/api/os/MXASSET?collectioncount=1&lean=1&oslc.select=description&oslc.where=status="OPERATING"%20or%20description="%25VALVE%25"

It fails with  "BMXAA8744E - The OSLC query was not parsed. Ensure that the query in the HTTP request follows the correct syntax of the OSLC query specification.\n\tEncountered \" <IDENTIFIER> \"or \"\" at line 1, column 20.\r\nWas expecting:\r\n    <BOOLEAN_OP> ...\r\n

If I change the "or" to an "and", it  works...  According to the documentation I can find, 7.6.1.3 should support or in the oslc.where clause.

Steven Shull's profile image
Steven Shull

The OR statement is implemented a bit differently than people might expect. There is a new query parameter (opmodeor) that you need to enable to treat the oslc.where as an OR statement. And you would still use "AND" in the query parameters.

For example, the following URL:

?lean=1&oslc.select=assetnum&oslc.where=assetnum="11430" and assettype="IT"&opmodeor=1

Would return anywhere the assetnum is 11430 or the assettype is IT. If you need to mix AND statements with OR statements, you should use a saved query or an automation script with search query parameters. I documented an example automation script here: IBM Maximo Autoscripting Guide – Object structure query

NOTE: I realize when I created the page I put "Until Manage 8.3 or Maximo 7.6.1.3, utilizing the oslc.where would not allow you to combine AND and OR statements in the where clause." but I misunderstood what was being added. I no longer work at IBM and can't update this page to correct my mistake.