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

    7 Comments

    1. senasana

      I dont know why, if I post the request to webhook.site its work fine, but when I try to sent the request to my own API server (external resource) from maximo it doesnt work, so this mean maximo endpoint only works for webhook similar server that not sent the response back to maximo or is there something that I missed here? I'm so appreciate if you could give me some guidance to work with maximo end point.

    2. Viet Tran

      Is your API running on SSL? If yes, you have to add the certificate to Websphere trust store

    3. senasana

      Yes correct the API server running on ssl and our maximo on weblogic.

    4. Henry B

      Hi Viet,
      Do you know a way in automation script re-write the URL on an HTTP end point in Maximo? For example, I am integrating Maximo to an external system using a REST API. I can successfully send a POST request to an end point to create a record in an external system. But when my original record in Maximo is updated later, I want to send a PUT request to update the record and need to pass the record ID as part of the API call. The HTTP end points URL has an "override" checkbox, but don't seem to have a straightforward way to include a substitution variable to pass a value to include in the URL.

    5. Samer.Karam

      thank you for posting this guide , but how can i add basic authentication to my API call ?

    6. Viet Tran

      What are you trying to do? Sending a PUT request from External System to Maximo or from Maximo to External System? For the lowest level implementation (when everything else fails): for Ext System -> Maximo: look at "Creating REST apis using Automation Script" section in the Automation Script feature guide for 7.6.0.9. It essentially allow you to build any REST api using script. For Maximo -> External System, you can utilize a core java Http Client package in automation script

    7. Viet Tran

      For authentication, you have to set it up in the Endpoint

    Leave a Reply