Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  Acessing External System REST API Using Maximo Automation Scripts

    Posted Wed March 25, 2020 10:49 AM
    I know there are lots of great material out there that showcase the power of Maximo REST API. But my question here is using Maximo automation script, how can we access another external systems Rest API. How to append the header details, the payload, etc. It would be great to share any sample scripts.

    ------------------------------
    keshav ravindran
    ------------------------------



    #Maximo
    #AssetandFacilitiesManagement
    #MaximoIntegrationandScripting


  • 2.  RE: Acessing External System REST API Using Maximo Automation Scripts

    Posted Thu April 09, 2020 09:09 AM
    Hi Keshav

    Sorry for the slow response - Anamitra provided the following
    jsonData = service.httpgetasjson("the url",None,None,None)
     
    asset = jsonData.get("assetnum")
     
    print asset
     
    Now the last 3 params - None,None,None - are userid,headers,password - in that sequence. They can pass the headers as a string like
     
    accept:application/json,header2:value,header3:value3
     
    basically a comma separate colon delimited set of header value pairs.
     
    We have a similar way to invoke a POST
     
    jsonData = service.httppostasjson(url,None,None,None,jsonReq)
     
    where jsonReq can be formed like below
     
    jsonReq = JSONObject()
    jsonReq.put("assetnum":"AS001")
    jsonReq.put("siteid":"BEDFORD")
     
    Note that here for some reason the order of the None,None,None -> user,pass,headers - so basically the password is right next to the userid (unlike the GET where its after the headers)
     
    Please let us know if this helps.



    ------------------------------
    Tom Sarasin
    Maximo Designer
    IBM
    (978) 899-2592
    ------------------------------



  • 3.  RE: Acessing External System REST API Using Maximo Automation Scripts

    Posted Sat April 25, 2020 03:49 PM
    Hi Tom,

    Thank you so much for sharing this information.

    ------------------------------
    Kalaiselvan Matheswaran
    ------------------------------