↓ Skip to main content
A pen and ink drawing of two wooden doors side by side in a stone wall. The left door is teal, with a brass key standing in its lock. The right door is orange, with a small barred window and a brass bell beside it. A stone step runs in front of both, with plants in pots at the sides.

API Keys, Tokens and the Two Routes of the Maximo REST API

The Maximo REST API in Practice - This article is part of a series.
Part 17: This Article
Every example in this series used /maximo/api and an API key. IBM’s own apps use /maximo/oslc and a login. Both reach the same API, and each refuses the other’s credentials. This article shows which route belongs to which client, and what a client sees when it uses the wrong one.

The rules here come from IBM’s documentation and from our own work with the REST API, on Manage in the MAS 9.2 series. We ran every request on our test system, which signs users in through MAS.

Two routes, one API
#

Two routes into the same API, each with its own credentials Two routes into the same API, each with its own credentials
Two routes into the same API, each with its own credentials

Behind both routes sits the same API: the same object structures, the same parameters, the same answers. The difference is the door.

  • /maximo/api takes an API key. Nothing in front of it asks for a login, so a script or an integration can call it without a browser.
  • /maximo/oslc sits behind the MAS login. A request without a valid MAS session never reaches Manage.

What each route answers
#

We sent the same query to both routes with different credentials:

RequestAnswer
/maximo/api/… with the header apikey200, the data
/maximo/api/… with the key as query parameter apikey=200, the data
/maximo/api/… without a key403 BMXAA7901E
/maximo/oslc/… with an API key302, a redirect to the MAS login
/maximo/API/…, the route in upper case404

The redirect is the one that confuses people. A client that follows redirects ends on an HTML login page and reports a parse error. When a JSON client suddenly reads HTML, check the route first.

Send the key in a header
#

Both ways of sending the key work, and the header is the right one:

GET /maximo/api/os/mxapiasset?lean=1&oslc.pageSize=1
apikey: <your key>

A query parameter is part of the URL. URLs end up in proxy logs, browser histories and the request logs of the server. A header does not. The key runs every call as its user, with all of that user’s rights, so it deserves the same care as a password.

An API key belongs to one user, and a user holds one key at a time. An administrator creates keys in the API Keys application of Manage. Create a separate user for each integration, give it only the security groups it needs, and give it a key. Then the logs show which integration did what, and one key can be revoked without stopping the others.

Logins MAS no longer accepts
#

Older Maximo clients sent a maxauth header with the user name and password in base64. MAS does not use it. We sent a valid user and password that way:

RequestAnswer
/maximo/api/… with maxauth403 BMXAA7901E
/maximo/oslc/… with maxauth302, the MAS login

Users in MAS sign in through MAS, with its own login page or a company identity provider. A client that cannot follow that login uses an API key on /maximo/api. That is the whole migration step for an old integration: replace maxauth with apikey, and /maximo/oslc with /maximo/api.

When the links point to the wrong host#

Every answer holds links: href, Location, the collection links. Manage builds them from a system property, so behind a proxy they can name an internal host. On our system every link began with http://localhost/maximo/api/. The request header x-public-uri sets the base:

GET /maximo/api/os/mxapiasset?lean=1&oslc.pageSize=1
apikey: <your key>
x-public-uri: https://maximo.example.com/maximo/api

The record link in the answer then read https://maximo.example.com/maximo/api/os/mxapiasset/_MTAwMS9CRURGT1JE. A client that follows links from an answer needs this header, or the property set right.

For members: the details
#

The member continuation goes further:

  • how a token from the MAS login works on /maximo/oslc, the header it needs and why /maximo/api ignores it,
  • what Manage does with an API key on each call, and where a key is stored,
  • the system properties that govern API keys, with the values of our test system,
  • a checklist for moving an old integration to MAS.

🔒 Authentication in the Maximo REST API: the details is members-only. To get access, get in touch.

What comes next
#

The last part of the series collects field notes. It starts with the error codes of the REST API and what each one means.

IBM’s own pages are the reference to keep next to this article:

  • API keys in IBM’s Maximo REST API guide on GitHub.

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 17: This Article