Category: Request

How to post HTTP requests using Automation script?

I want to post a simple JSON message to an external system and do not want to add any external library to Maximo as it would require a restart.

In the past, I used the Java HTTPClient library that comes with Maximo, but it would require half a page of boilerplate Jython code. Recently, I found a simpler solution below.

Step 1

First I use WebHook as a mock service for testing. Go to webhook.site, it will give us a unique URL to send request to:

    Step 2

    Go to the End Point application in Maximo to create a HTTP Endpoint

    • End Point Name: ZZWEBHOOK
    • Handler: HTTP
    • Headers: Content-Type: application/json
    • URL: <copy/paste the Unique URL from webhook>
    • HttpMethod: POST

    Step 3

    To ensure it’s working, Use the Test button, write some simple text, then click on “TEST”. Maximo should show a successful result. In Webhook, it should also show a new request received. (Note: if it gives an error related to SSL, it’s because Websphere doesn’t trust the target website. You’ll need to add the certificate of the target website to Websphere trust store)

    Step 4

    To send a request, just need two lines of code as follows:

    Update: For a more advanced query requirement, please refer to this new post: Send HTTP Request from Automation Script

    Interacting with Maximo via SMS with Twilio

    Voice call and SMS are being used as a user interaction interface in many systems and services provided by large organizations. However, in the past, this integration is quite complex and expensive, and I never had a chance to play around with it. Recently, I posted an article on how we can easily configure Maximo to send SMS notifications. This is made easy and free (for developers) by using Twilio.

    Sending inbound commands to a system from Twilio is more complex as it requires setting up a Web Server and writing code to parse HTTP POST requests, then forward the message to an onpremise Maximo system. With App Connect, it becomes easy (and free for developers) to set up an API gateway on the cloud and route messages to a system hosted in-house. I decided to give it a crack by imagining two easy use cases as follows:

    • Field workers send a text message to Maximo to create a new Work Request, or to report a Defect. This could be useful to quickly register an action item without having a smart device or 3G connection. Below is a quick demo of this scenario:
    • A user approves a workflow request by sending a SMS command. This could be useful for supervisors or managers who are always travelling or in meetings and don’t check email often. In many cases, the managers are often given a heads-up call, approving workflow is just a formality to keep record. With such scenarios, just reading the title of the request in a text message will be enough for the approver to say Yes or No, this approach could speed up the approval process. Below is a quick demo for this use case:

    There are many other use cases we can implement SMS, MMS, or Voice command to add value. I can quickly think of a few such as

    • Field workers sending an acknowledgement of new work order assignment and confirmation of  scheduled start time entered by planners
    • Driver sending in telemetry data (fuel level, mileage etc.) or technician sending in asset meter data
    • Workers updating actual labour hours to work orders.
    • And whatever simple yet important data you can think of here

    For the technical consultants who are interested in App Connect, the image below is how I integrated Twilio with Maximo via App Connect:

    This may look a bit complex, but in fact, it is quite simple. The whole process to set up AppConnect, hook up with Twilio and Maximo takes less than 15 minutes. For Maximo on the cloud, I guess we can configure Maximo to hook up with Twilio directly. But I don’t have access to a cloud Maximo environment which I can mess with. So perhaps, that can be saved for a future article.