Maximo

Maximo

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

 View Only
  • 1.  Maximo to External System Integration with Dynamic Token in POST URL (No Middleware)

    Posted Mon May 05, 2025 09:35 AM

    Hello Maximo Experts,
     
    We have a requirement to have point-to-point integration between IBM MAS 9 and an external system to send Work Order data.
     
    Integration Requirement:
     
    Before each POST request, we must first call a token endpoint to fetch a new token.
     
    The retrieved token then needs to be appended to the POST URL before sending the Work Order data.
     
    There is no middleware involved in this setup.
     
     
    Looking for suggestions on:
     
    1. How can we invoke the token API and capture its response before triggering the actual POST?
    2. What's the best way to dynamically update the POST URL with the new token? 
    3. Any best practices or examples for managing such token-based authentication flows in real time within Maximo?

    4. Pros & Cons 
     
    Would appreciate any guidance or references from those who've dealt with similar scenarios.
     
    Thanks in advance!



    ------------------------------
    Tanishk Rathi
    ------------------------------


  • 2.  RE: Maximo to External System Integration with Dynamic Token in POST URL (No Middleware)

    Posted Tue May 06, 2025 03:08 AM
    Edited by Andrzej Więcław Tue May 06, 2025 03:20 AM

    Hi Tanishk,

    AD #1 & #2

    in order to inject different kinds of customizations into outbound processing at the actual message delivery stage you typically use End Point with Maximo standard HTTP handler and its HTTPEXIT property, pointing to a class (implementing psdi.iface.router.HTTPExit interface) or use Endpoint script (note the spelling difference) capabilities - more specifically HTTP Handler Exit.

    Focusing on the latter, you most likely need to run additional HTTP request(s) to get the API token and use it as a request header. It can be done by implementing this logic in headerProps(req) function of your automation script. You can use whole spectrum of available automation scripting capabilities to make those HTTP calls (out of the scope of this reply). Finally you register the automation script itself in the HTTP Handler's HTTPEXIT property as script:{script name}, instead of Java FQCN.

    AD #3

    When it comes to best practices then I believe it's the best to refer how Maximo implements OAuth 2.0 support (ref. @Surender Balasundaram Maximo Manage MAS HTTP End Point with OAuth Configuration article). 

    AD #4

    As you noticed in general it's fully supported in Maximo use case to acquire additional details in order to successfully send an integration message using non-static delivery details. You need to be however fully aware of potential consequences in both Maximo and external system of the additional actions you're going to implement. For simple deployments (not too frequent messaging) it may be good enough to acquire new token every time, every single message is going to be sent out, but for higher volumes of messages or in case of any authentication endpoint request limits in your external system, you may need to implement API token caching mechanism which will allow you to reuse API token throughout several requests. In such case of course you need to take into account other aspects as: where to store it, for how long it can be reused, how/when it should be refreshed, etc. I think it's best to have a look at Maximo standard psdi.iface.router.OAUTHClient implementation while seeking for inspiration how to do that.



    ------------------------------
    If this post helps, please consider accepting it as a solution to help other members find it more quickly.

    Andrzej Więcław
    Maximo Technical SME
    ZNAPZ B.V.
    Wrocław, Poland
    ------------------------------



  • 3.  RE: Maximo to External System Integration with Dynamic Token in POST URL (No Middleware)

    Posted Wed May 07, 2025 02:26 AM

    Hi Andrzej,

    Thanks for the response!

    Once we are getting the token, we want to send the data to target system and the concerning point for me is can we store the sent message/payload.

    If we can be able to store the payload, could you just guide me with the reference.

    Thanks in advance for the great help!



    ------------------------------
    Tanishk Rathi
    Senior Maximo Developer
    Tata Consultancy Services
    Pune
    ------------------------------



  • 4.  RE: Maximo to External System Integration with Dynamic Token in POST URL (No Middleware)

    Posted Tue May 06, 2025 11:03 AM

    Tanishk,

    You will want to use a script in the HTTPEXIT on the HTTP handler.  You can do this by setting "script:SCRIPT_NAME" as the HTTPEXIT value on your handler.  This script will then be called as part of the outbound call, allowing you to update parameters, headers and other parts of the HTTP handler call.

    In your specific case you can implement the headerProps callback and make whatever calls you need to to get your token then inject the result back into your call.

    Details are here:

    https://www.ibm.com/docs/en/masv-and-l/maximo-manage/cd?topic=scripts-http-handler-exit

    Let me know if you have any questions.



    ------------------------------
    Jason VenHuizen
    Sharptree
    https://sharptree.io
    https://opqo.io
    ------------------------------



  • 5.  RE: Maximo to External System Integration with Dynamic Token in POST URL (No Middleware)

    Posted Wed May 07, 2025 02:27 AM

    Hi Jason,

    Thanks for the reply!

    Just thinking about the error handling mechanism.



    ------------------------------
    Tanishk Rathi
    Senior Maximo Developer
    Tata Consultancy Services
    Pune
    ------------------------------



  • 6.  RE: Maximo to External System Integration with Dynamic Token in POST URL (No Middleware)

    Posted Wed May 07, 2025 11:29 AM

    The exit callbacks occur as part of the end point handling so any errors you throw will be handled by the interface in the standard way.  So for example if you are using a JMS Queue the error will halt the transaction and place the record in the error reprocessing queue.

    Jason



    ------------------------------
    Jason VenHuizen
    Sharptree
    https://sharptree.io
    https://opqo.io
    ------------------------------