action parameter. This article shows how to find, call
and check them.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, against IBM’s demo data, as a user
without administrator rights. The examples act on service requests through the object structure
MXAPISR, created for this article and deleted afterwards.
One parameter, four kinds of action#
The value of action has the form <type>:<name>. Without a type, Manage looks for an action
defined on the object structure first, then for a system action.
Which actions a record offers#
Add allowedactions to the select:
GET /maximo/api/os/mxapisr/<rest id>?lean=1
&oslc.select=ticketid,allowedactionsThe answer holds one entry per action, keyed by its full name. A service request offers dozens
of them: web methods such as wsmethod:changeStatus and wsmethod:createWorkorder, and system
actions such as candelete, duplicate and getlist. Each web method describes its own call:
"wsmethod:changeStatus": {
"type": "wsmethod",
"httpmethod": "POST",
"impl": "changeStatus",
"requestschema": {
"type": "object",
"properties": {
"status": { "type": "string" },
"memo": { "type": "string" },
"date": { "type": "string", "subType": "dateTime" }
}
}
}So a client does not have to guess the body. The schema names every parameter and its type.
Call a web method#
A web method acts on the record of the URI. The POST needs x-method-override: PATCH, so Manage
loads that record first:
POST /maximo/api/os/mxapisr/<rest id>?lean=1
&action=wsmethod:changeStatus
x-method-override: PATCH
properties: status{ "status": "QUEUED", "memo": "Sent to the help desk" }With properties, the answer is 200 and holds the changed record, here "status": "QUEUED".
Without it, the answer is 204. The parameters can also go into the query string:
&action=wsmethod:changeStatus&status=PENDING with an empty body answered 204 and set the status.
Three mistakes and their answers:
| Request | Answer |
|---|---|
the POST without x-method-override: PATCH | 500, a null pointer message |
| the same call as a GET | 400 BMXAA9484E, “The HTTP POST method must be used” |
| a method name that does not exist | 400 BMXAA9372E, “The action method nosuch was not found” |
The first one is the trap: the message says nothing about the missing header.
The article on bulk requests uses changeStatus
to cancel a work order, and shows a bulk request that calls it for many records at once.
System actions#
Manage ships actions that work on any record. Four of them answer a GET:
| Action | What it answers |
|---|---|
candelete | the record when a delete is allowed, else the error a delete would give |
duplicate | a copy of the record with a new key (unsaved) |
getlist~status on the record URI | the status values with their internal values |
new on the collection URI | a new record with its defaults (unsaved) |
new and duplicate fill in a key, such as a new ticket number, and save nothing. We looked both
records up afterwards, and both answered 404. A form can use them to show the defaults before the
user saves.
Start a workflow#
A workflow process starts with its name:
POST /maximo/api/os/mxapisr/<rest id>?lean=1
&action=workflow:<PROCESS>
x-method-override: PATCHThere is a trap here. We started a process that does not exist, workflow:NOSUCHPROC. The answer
was 204, the same as a success. A failed start looks exactly like a good one. So check the
result yourself: the system action activewfinstances lists the active
workflows of the record.
GET /maximo/api/os/mxapisr/<rest id>?lean=1
&action=activewfinstancesAfter our failed start it answered an empty list, "member": []. A workflow start in an
integration is not finished until this list shows the process.
Automation scripts as endpoints#
A script can be an endpoint of its own, or an action on an object structure:
GET /maximo/api/script/<NAME>runs the script and returns what it writes toresponseBody. A two-line test script answered our plain user like this:var site = request.getQueryParam("site"); responseBody = JSON.stringify({ site: site, answer: "hello from a script" });GET /maximo/api/script/RESTDOC.HELLO?site=BEDFORDanswered 200 with{"site":"BEDFORD","answer":"hello from a script"}. The script name in the URI is matched without case.An action defined on the object structure runs a script with the record of the URI:
POST <record URI>?action=MYACTIONwithx-method-override: PATCH.
Our series on automation scripts covers both in depth: your own REST API with a script and object structure actions and query scripts.
For members: the action catalogue#
The member continuation lists what the short version leaves out:
- the action catalogue of a record and of a collection, with
allowedactions=1, - which web methods answer a GET, and how they return a value,
- the
serviceroute, which calls a web method without a record, statuslist,islockedand the other system actions that read state,- what each kind of action needs from the request.
🔒 The action catalogue of the Maximo REST API is members-only. To get access, get in touch.
What comes next#
IBM’s own pages are the reference to keep next to this article:
- Actions and Automation scripts in IBM’s Maximo REST API guide on GitHub.
The next part of the series watches IBM’s own clients: what the Manage UI and the MAF web apps send. 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.
