Maximo Open Forum

 View Only
  • 1.  OSIN/OSOUT integration automation script with Rest API

    Posted 01-16-2025 10:15

    Hi Everyone,

    I have a question related to logging Maximo Rest Api Response (Rest Api using Object Structure).

    In Scripts related to Object Structures I can access the request in OSIN Scripts.

     

    I would like to know if there is a way to get a hold of the response body in OSOUT Script or if there is another way to get a hold of the response produced by the call to said Rest Api. 

    Thank you in advanced


    #Customizations
    #EverythingMaximo
    #Integrations
    #MaximoApplicationSuite

    ------------------------------
    André Cordeiro
    ------------------------------


  • 2.  RE: OSIN/OSOUT integration automation script with Rest API

    Posted 01-17-2025 08:59

    No, the OSOUT is prior to the response being built. This is a chance for you to manipulate the data that will be used in the response, such as modifying the description without modifying the actual description field on the record. Our best documentation on the OSIN/OSOUT automation script is here: https://ibm-maximo-dev.github.io/maximo-autoscript-documentation/integration/osevents . We describe what is available for both inbound & outbound. 

    Depending on what you are trying to do, there might be another way to achieve it. For example, if you want to build out a complex attribute that doesn't correspond to an attribute you can use this method: https://ibm-maximo-dev.github.io/maximo-autoscript-documentation/rest/restscriptattr 



    ------------------------------
    Steven Shull
    IBM
    ------------------------------



  • 3.  RE: OSIN/OSOUT integration automation script with Rest API

    Posted 01-21-2025 12:26

    Hi Steven,

    Thanks for your reply.

    The thing here is we would like to know where could we get the final response generated from the Rest API in order to log it. 

    Would be great if you can give us an simple example.

    Thanks



    ------------------------------
    André Cordeiro
    ------------------------------



  • 4.  RE: OSIN/OSOUT integration automation script with Rest API

    Posted 01-21-2025 16:57

    We only really provide a way to log the inbound requests (https://www.ibm.com/support/pages/message-tracking-synchronous-requests). It's worth mentioning this is not good to leave enabled long term due to performance issues it introduces.

    I don't know of a way to track the response body of the API requests without modifying the MaximoOslcProviderServlet java class which would be a terrible idea since you can't extend it (like you could with a lot of other core classes). The way we track a request (in the trackSuccessRequest method), the servlet has access to the response body so it shouldn't be too difficult for the product team to add. Potentially, have them add an automation script event here so people could store or log this data in any system they wanted rather than adding it the way we do. 



    ------------------------------
    Steven Shull
    IBM
    ------------------------------



  • 5.  RE: OSIN/OSOUT integration automation script with Rest API

    Posted 07-23-2025 11:18
    Edited by Robert Matthews 07-24-2025 11:29

    Editing this 7/24--I had an error in my initial query params in a GET which was causing the multi-record return not to include desired values. Getting however many related values via oslc.select using relationship.attribute notation solves my immediate requirement. 

    I'll circle back if needed to the question below of how to do variable assignment from mbo structure followed by json parse / reserialize outbound only if the query param option isn't viable.

    -- 

    I've been looking at the documentation for manipulating outbound (Rest/JSON) message bodies and am still unsure the functions or functions for adding a new attr:value pair in the outbound message via OSOUT script, and when based on a value looked up from the mbo--

    eg, when you want to include displaynames in a response for an object that has only user ids, and you've run into the issue with only one join to the same table from a parent on the OS. MBO includes IDs and we want to include displaynames in the outbound message

    • approver.displayname
    • pm.displayname
    • owner.displayname
    • certifier.displayname
    • etc.



    ------------------------------
    Robert Matthews
    ------------------------------