Communication with external applications through REST API
In Maximo Asset Management, Remote Method Invocation (RMI) can be used to interact with the product from custom extensions or external applications. However, RMI is not supported outside of the Maximo® server process in the fully containerized environment of Maximo Manage. You use REST API instead of RMI for interactions with the product from custom extensions or external applications.
To help with using REST API, the product provides a sample HTTP client, which is the com.ibm.tivoli.maximo.oslc.provider.RestClient class. This sample HTTP client is a library of many useful methods and other libraries.
REST API benefits for integrating with the product
- A REST API client can be written in the language of your choice, while with RMI, you can write only in the Java™ language.
- REST API promotes ease of customization and integration with your client applications by using object structures.
- REST API can use API keys for authentication and authorization. All communication with the product can be done with any basic HTTP client, such as the sample RestClient HTTP client that is included with the product.
- Well-designed REST API calls provide high scalability with less network traffic. Several ways to design and code the REST API calls are explained in the following sections.
REST API coding options
REST API coding is generally at a fairly high level, but the product offers options to make the code granular if you require granularity. You can code your API calls as multiple REST calls, bulk REST calls, or REST calls that use automation scripts.
The amount of generated network traffic can vary, depending on the way that you code the REST API interaction for your client. If REST API interactions are not coded correctly, client and product performance might be negatively impacted.
Multiple individual REST calls
If you are moving from using RMI in earlier product versions, you can convert your RMI calls to REST calls on a one-to-one basis. However, RMI allows granular API use in the Java SDK that is provided with Maximo Manage, while the REST APIs are higher level. Additionally, it is possible that not every RMI call has an equivalent REST API call because REST APIs are not available for all of the Java SDK of the product.
Network traffic can be high if you code with multiple REST calls because of the number of network calls.
Bulk REST calls
With bulk REST calls, you write code for one call that acts on a set of records that meet your criteria. Bulk REST calls offer better network performance than multiple individual REST calls. However, you might have issues with lack of equivalency of REST APIs with granular RMI calls.
REST calls that use automation scripts
REST calls that use automation scripts offer the best granularity and network performance. With this approach, you can access the full Java SDK, which is not possible with the other approaches.
You write an automation script in the Automation Scripts application and call that script using the REST client. The scripting framework carries forward the API query parameters to the script. The automation script can be written in many languages.
Coding REST API using automation scripts also gives you a way to organically create REST APIs that suit your environment and that can be used elsewhere.