↓ Skip to main content
A pen and ink drawing of a desk. A large orange brass ear trumpet lies on it, its bell turned toward an old wooden wall telephone with a teal earpiece and a coiled teal cord. In front of it an open notebook holds rows of orange dashes and teal dots, with a fountain pen across the pages. A desk lamp, a pen pot, a box of index cards, an ink bottle and a stamp stand around it.

What the Manage UI and MAF Web Apps Ask the REST API For

The Maximo REST API in Practice - This article is part of a series.
Part 12: This Article
The best teacher for the REST API is IBM’s own code that calls it. Every MAF web app in Manage talks to the same API you use from a script. We opened the browser’s network view and watched what IBM’s apps send. This article shows the patterns, and which of them belong in your own client.

We recorded the requests on our test system, on Manage in the MAS 9.2 series, as a user without administrator rights. We opened Work Order Tracking, the MAF web app Work Orders, and the Service Request app in the browser, listed records, opened one, and created a service request. The first two parts of this series explain the parameters one by one. Here you see them together, the way IBM uses them.

Two protocols in one window
#

The first surprise: a Manage screen can hold two clients at once.

The shell and the MAF apps use the REST API, the classic screens their own protocol The shell and the MAF apps use the REST API, the classic screens their own protocol
The shell and the MAF apps use the REST API, the classic screens their own protocol

Manage 9.2 opens every application inside a shell, a MAF app of its own. The shell loads the user, the permissions and the menu through the REST API. A classic application such as Work Order Tracking then runs in a frame inside it. That frame never calls the REST API for its work. A click on a list row became one POST to /maximo/ui/maximo.jsp, with form fields and a list of UI events:

uisessionid=17&csrftoken=…&requesttype=SYNC
&responsetype=text/xml
&events=[{"type":"click","targetId":"…_tdrow_[C:1]…"}]

The answer is XML that tells the page what to redraw. This protocol belongs to the classic UI, and IBM documents it nowhere for outside use. So the classic screens are no model for an integration. The MAF web apps are.

The session route
#

Every MAF call goes to /maximo/oslc/… with the browser session. None uses /maximo/api/…, the route for API keys from Part 1. The two are not interchangeable: the same /oslc URL called with an API key returned the HTML login page on our system.

A session client needs one extra step for writes. The first call of every app is:

GET /maximo/oslc/login?csrf=1&lean=1

Manage answers with the session timeouts and sends a CSRF token in the response header csrftoken. The app returns it in the request header csrftoken on every POST. A client with an API key on /maximo/api needs neither.

Four parameters on every call
#

Every request of the MAF apps ends with the same four parameters:

ParameterWhat it does
lean=1plain JSON names, as in every example of this series
relativeuri=1href values come back relative, api/os/…
internalvalues=1a synonym attribute also returns its internal value, status_maxvalue
checkesig=1Manage asks for an electronic signature where one is configured

List requests add three more:

ParameterWhat it does
collectioncount=1totalCount in responseInfo
ignorecollectionref=1leaves out the links to child lists of every record
addschema=1the JSON schema of the selected attributes in responseInfo

Two of these pay off in your own client. internalvalues=1 gives you the internal status value, so a check like “is this work order approved” works in every installation, whatever its status synonyms are called. ignorecollectionref=1 removes dozens of link fields from each record of a large object structure such as MXAPIWODETAIL.

A real list query
#

This is the list request of the Work Orders app, shortened to the parts that matter:

GET /maximo/oslc/os/mxapiwodetail
  ?oslc.select=wonum,description,status,assetnum,
     worktype.wtypedesc,worktype--worktypename,
     serviceaddress.formattedaddress--formattedaddress,
     status_description,status_maxvalue,
     rel.multiassetlocci{rel.asset{assetnum}}
  &searchAttributes=wonum,description,location,
     assetnum,status
  &oslc.pageSize=20
  &collectioncount=1&ignorecollectionref=1
  &addschema=1&lean=1&internalvalues=1

Almost every feature of the first part of this series is in it:

  • Dot paths read a related record in the same call: worktype.wtypedesc.
  • Aliases with two dashes rename an attribute in the answer: worktype--worktypename.
  • Nested rel. selects read a child list and its related records.
  • searchAttributes names the fields the search box searches, see saved queries and search terms.
  • A page size of 20, the length of the visible list.

The oslc.select article explains each of them.

What to copy into your own client
#

From what we recorded, these habits are worth taking over:

  • Select only the attributes the screen shows, and read related values with dot paths.
  • Send internalvalues=1 and compare status values by their internal value.
  • Send ignorecollectionref=1 on lists.
  • Ask for the JSON schema with addschema=1 once, when you need titles, lengths or types.
  • Keep the page size near what you display, and let the user page.
  • Use the API key route /maximo/api for an integration. The session route with its CSRF token is built for a browser.

The full recording, for members
#

The member continuation goes through the rest of the recording, request by request:

  • the boot sequence every MAF web app runs, and what each call returns,
  • the X-MAF-* headers that name the app and the datasource of each request,
  • a query sent as a form POST, the way the detail page loads its record,
  • value lists through zombie/getlist~status, and the schema calls,
  • the writes: the view an app saves on first open, and a create with batcherror and a context flag that starts the workflow,
  • two requests that fail on every page, and why.

🔒 Inside the requests of the Manage UI and MAF web apps is members-only. To get access, get in touch.

What comes next
#

The next article watches Maximo Mobile on a device, where the same REST API fills an offline database. The series overview lists all parts. If you want help with the REST API in your own Manage, our services page shows how we work.

IBM and Maximo are trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide.

The Maximo REST API in Practice - This article is part of a series.
Part 12: This Article