Please help me if anything wrong in my code or any other configuration is missing
Original Message:
Sent: Thu March 20, 2025 09:39 AM
From: Jason VenHuizen
Subject: Open a External Website with Params from Maximo
The map that you pass into the invoke call will get update with an entry with the key of RESPONSE_HEADERS, which is itself another Map object that has a key of RESPONSE_STATUS that is the HTTP status code from the response. There is also a key of RESPONSE_STATUS_TEXT that contains the response text as well.
Hope that is what you are looking for.
- Jason
------------------------------
Jason VenHuizen
Sharptree
https://sharptree.io
https://opqo.io
Original Message:
Sent: Wed March 19, 2025 04:03 PM
From: Nandisha MS
Subject: Open a External Website with Params from Maximo
Hello Biplab,
I am using to call endpoint which is configured Oauth authorization as below
response = service.invokeEndpoint(httpendpoint_name, map, jsonBody)
Here, i am facing problem, i e if connection is successful to source will get data else if connection is failed, How we can identify? any solution to get the status code like 200 is success and other is Unsuccess.
why because, if my connection is failed with source then i need to send an email notification to take appropriate action to re-request.
Note: expectation is to get the status code of my request.
Appreciate your response. Thanks
------------------------------
Nandisha MS
Original Message:
Sent: Mon April 12, 2021 09:59 AM
From: Biplab Choudhury
Subject: Open a External Website with Params from Maximo
Hi Daniel,
Really good solution. Learnt a lot.
Just 1 thing I would have done differently is the creation of custom json format using custom autoscript.
In place of auto script , you can use JSON Mapping application to map maximo data into the D365 format json. Very simple and useful solution without coding. Hope it will be useful in future integrations.
Thanks,
Biplab
------------------------------
Biplab Choudhury
Maximo Consultant
Tata Consultancy Services
Melbourne
Original Message:
Sent: Mon April 12, 2021 09:21 AM
From: Daniel Gruszka
Subject: Open a External Website with Params from Maximo
Hello Priyaranjandas,
Yes, I defined 2 different HTTP endpoints.
1) OAUTH Endpoint
I store the CLIENTID in the USERNAME field and store the CLIENTSECRET in the PASSWORD field. Maximo doesn't do anything with these automatically, it is just a way for me to store those login values. The HEADERS must be set to
"Content-Type:application/x-www-form-urlencoded"

I then wrote a library script which calls this endpoint and returns the token. This library script is called within my publish channel automation script: PUBLISH.MYSCRIPT.EXTEXIT.OUT
This script will fire on the outbound event for our publish channel. The library script was just a way to encapsulate all the logic for calling the OAUTH endpoint, parsing and getting the token etc. We also check how recently the token was last updated.
Here is the call to the library script:
# Call OAUTH endpoint, this will update token on our HTTP call to D365 if needed
omap = HashMap()
omap.put('oauthEnd', 'D365_OAUTH')
omap.put('httpEnd','D365_HTTP')
service.invokeScript('LIB_OAUTH', omap)
2) To understand how the library script works, first you need to understand the HTTP endpoint for our actual integration. Again, the endpoint above is just a way to store the data used to get the token. I only access that endpoint manually via scripting. This next endpoint is the actual HTTP endpoint that lives on our Publish Channel:

The URL property is the resource you are connecting to including the data entity (This is probably D365 specific), in my example "MyDataEntity".
https://myenvironment.dynamics.com/data/MyDataEntity
The real trick to making this work was allowing override on the HEADERS and also updating the database field size on MAXENDPOINTDTL.VALUE. This is because our library script will call the OAUTH endpoint and grab the token and then SAVE it to the headers on this endpoint. That way Maximo can then just do it's normal integration routine and the whole process will work without any involvement. Here is a snippet from the OAUTH library script. I am taking the header and appending the token that was just received from the OAUTH endpoint call. I then save that updated header (that is why allow override is required). I also realized Maximo caches endpoint data so you must do that MXServer call to reload cache.
# Full Header, Update HTTP Endpoint
fullheader = "Content-Type:application/json,OData-MaxVersion:4.0,OData-Version:4.0,Authorization:Bearer "+token
endpHeader.setValue('value',fullheader)
endpHeadSet.save()
MXServer.getMXServer().reloadMaximoCache('MAXENDPOINT',True)
Once you get that token and add it to the header on your HTTP Endpoint, then Maximo can format the integration message and send it.
One other issue we had was that Maximo formatted JSON different than D365 required so I had to manipulate that manually in our publish channel script. I create a blank JSON object (to store my new message) and then get the existing JSON message that Maximo created. I then go through the existing message, format fields and data accordingly and add it into my new JSON object.
#Create new Json
jsnObj = JSONObject()
# Get existing integration message in JSON map
jsonIR = JSONObject.parse(irData.getDataAsString())
Once I finish all that logic, I can take the new JSON record I created with all the updated data and assign it back to the irData. This means that Maximo can then use it in the rest of the integration flow just as if this was an out of the box message. It has no idea that we manipulated it. This also allows Message Reprocessing to still work.
# Assign our new JSON object to the integration message, this will replace it with our new JSON we created above
irData = StructureData(StringUtil.toBytes(jsnObj.serialize(True)))
Hope that helps, this is pretty complex, took us a few months to get finished with all the troubleshooting. This should save you a ton of time though.
-Dan
------------------------------
Daniel Gruszka
Original Message:
Sent: Thu April 08, 2021 11:51 PM
From: Priyaranjandas Kolambkar
Subject: Open a External Website with Params from Maximo
Hi Daniel,
I hope you were able to make this solution working. We are also having a requirement to integrate with an external system using OAUTH2 authentication. Just wanted to clarify that you have effectively defined 2 different HTTP endpoints? (The 365OAUTH endpoint which you have defined is an HTTP endpoint?). First endpoint is to get the token from the external system. Using this token in the second HTTP endpoint, you access the resource in the external system by updating the token in the HEADER property.
What are the values for the other properties like URL and HTTPMETHOD?
Would appreciate if you could shed some more light and if possible can you share the ASCRIPT code for the same?
Regards,
Priyaranjandas
------------------------------
Priyaranjandas Kolambkar
Original Message:
Sent: Thu September 24, 2020 09:35 AM
From: Anamitra Bhattacharyya
Subject: Open a External Website with Params from Maximo
Hi
just wanted to share my 2 cents in this discussion - there is a feature in Maximo publish channel integration that allows one to dynamically override endpoints or even the endpoint properties.
To override an endpoint ie dynamically setting the endpoint
-----------------------------------------------------------------------------
Assuming you are writing a java user exit or a script user exit - you can just use the following line of code to override an end point in publish channel
from psdi.iface.mic import MetaDataProperties
from psdi.iface.mic import IntegrationContext
IntegrationContext.getCurrentContext().setProperty(MetaDataProperties.ENDPOINT, "my endpoint name")
Now of course you can make it smart by checking some sdata (StructureData) content -wrapping the above statement using if else etc etc
Note that this pretty much gets flowed through the queue - to the MIF endpoint framework - which checks this property and override the default endpoint set as part of the external system setup.
Note also that - this setting is "sticky" => if ur pub channel is going to multiple External systems - you are going to end up overriding all those by this same endpoint. Effectively till 7610 there was no way to scope this change to a specific external system for that pub channel. However we enhanced that in 7611 to support that scoping. Basically you can set a java Map object instead of "my endpoint name" - key in the map is the external system name and the value is the endpoint name => effectively allowing one to control the override per external system. Note that this is only needed if ur pub channel is associated with >1 External system
To override endpoint properties in pub channel exit
-----------------------------------------------------------------------------
In this model - instead of overriding the full endpoint - you can selectively override some of the properties of that endpoint. Note that for this thing to work - you need to make sure that your endpoint properties are marked as "overridable" .
Assuming you are writing a java user exit or a script user exit - you can just use the following line of code to override an end point in publish channel
from psdi.iface.mic import MetaDataProperties
from psdi.iface.mic import IntegrationContext
map = //create a java Map here
//put property name/override value pairs in that map
IntegrationContext.getCurrentContext().setProperty(MetaDataProperties.ENDPOINTPROPS, map)
This one though does not have any scoping to external systems.
These features are used internally by location services/Esri integration.
thanks
Anamitra Bhattacharyya
STSM, Maximo, IoT
IBM Master Inventor
Original Message:
Sent: 9/23/2020 5:13:00 PM
From: Steven Shull
Subject: RE: Open a External Website with Params from Maximo
Correct, if you're using a publish channel the publish channel invokes the endpoint. There are some use cases where it makes sense to invoke an endpoint from an automation script instead of utilizing a publish channel. Publish channels queue up messages and then try to send to the external system (the user isn't aware of success or failure). This can be a plus, but other times it's critical that the integration occurs immediately or the transaction inside of Maximo fails (change status is rolled back, labor transaction isn't saved, etc.). That's not possible with a publish channel. Less importantly, other systems can't process a Maximo message, so you have to transform the XML/JSON message into a format the other can consume and it's sometimes easier to build it directly as you need in a script instead of transforming.
I want to preface this with I haven't done this, but this is something we are planning to look at doing to improve some of our integrations.
HTTP endpoints have a HTTPEXIT property that allows you to set a Java class (typically). What most people aren't aware of is you are supposed to be able to set it to script:SCRIPTNAME (replacing SCRIPTNAME with your automation script name) and that will invoke your script.
I have never seen this fully documented on how to do it end to end, but there is some info such as how to declare your script that can be found here: HTTP handler (ibm.com)
First things first, your script needs to be set to "Allow invoking methods" or else it won't work. Secondly inside your script you need to declare a function that matches what they're looking for. For example, if you wanted to control the header and were using python, you should have something like this:
def headerProps():
# Your logic here
Depending on your function will determine what gets stored in an invokeArgs implicit variable (that is an object array). For the header it looks like Maximo declares a ScriptHTTPReq class that it puts in an object array that gets stored in the invokeArgs that you can reference in your script. Once you get that ScriptHTTPReq class you can call methods such as addHeader(name,value) with the appropriate header name and value that you want to add to the HTTP request and it should modify it.
If you haven't gotten comfortable with it, I would recommend using a java decompiler as it's easier to understand what's possible and what's going on in situations like this that aren't very well documented.
------------------------------
Steven Shull
Director of Development
Projetech Inc
Cincinnati OH
Original Message:
Sent: Tue September 22, 2020 06:47 PM
From: Daniel Gruszka
Subject: Open a External Website with Params from Maximo
"If it's static you would define it on the end point to remove it from the code otherwise you would just put it in the override map before calling the end point."
I am struggling with the part about calling the end point. Doesn't this happen automatically in many cases? In my scenario, I have an event listener that automatically calls my publish channel which is associated with my external system / end point. How do I interject myself in that flow and override anything by code? I don't call the endpoint, the event does.
------------------------------
Daniel Gruszka
Original Message:
Sent: Fri June 26, 2020 09:21 AM
From: Steven Shull
Subject: Open a External Website with Params from Maximo
I'm not sure what the last part of your message means about you can only deliver the body with an end point. With end points you can (and almost always have to) control headers and/or the URL. If it's static you would define it on the end point to remove it from the code otherwise you would just put it in the override map before calling the end point. Something like:
map.put("HEADERS","Authorization:basicAuthHeader,Header2:header2value")
That would add 2 headers to your request (Authorization & Header2) with the values that follow provided that you set it up on the end point to allow overrides.
I definitely agree that end points aren't well documented aside from utilizing as a publish channel which isn't always a viable option. And any time you end up at the code stage (automation script or java) IBM support isn't allowed to assist. I personally hope to create more content (blogs, webinars, video recordings, etc.) as I know the feeling when you know something is possible but can't figure out how. I've worked exclusively with Maximo for 10 years in a rather unique role and I'm still constantly learn new things, especially from others in the industry. What sometimes is lacking in official documentation, you'll often be able to find people inside of the Maximo communities willing to help outside of their "day job".
------------------------------
Steven Shull
Director of Development
Projetech Inc
Cincinnati OH
Original Message:
Sent: Thu June 25, 2020 12:15 PM
From: Appu Nair
Subject: Open a External Website with Params from Maximo
Thanks Very much, guys. I am seeing light at the end of the tunnel. Unfortunately with no domain knowledge and with almost every example that one looks yielding to a broken IBM Community(Don't worry I come from another Enterprise App who are notorious for doing the same thing) link it is harder.
Your knowledge and timely help are much appreciated . I will keep pinging when I am stuck in a particular aspect.
Just like an example that shows how the MXPERSON Object using JMS Queues get dumped to a file system(That too if you didn't know how to set maximo properties you are stuck), it might be worth IBM Maximo people's time to show an example of using an HTTPHandler, a JAX handler and so on using perhaps a non-ibm system ( I wouldn't go as far as the REST example). Essentially if the reader knows how to use SOAPUI how do you take it from there.
In my case, I struggled many days until I learned that the SOAPUI Body message is all I could deliver with the End Point. True for experienced people it would be a piece of cake as you say but how do you stuff a header.IBM trouble ticket people said I would have to code :)
------------------------------
Appu Nair
Original Message:
Sent: Wed June 24, 2020 12:12 PM
From: Biplab Choudhury
Subject: Open a External Website with Params from Maximo
Hi Appu,
Adding to Steven's last comment, Maximo has a number of ways and options to call external applications and you should try and use them.
One other way it that you can also setup a json mapping to send a json data outside without writing a single line of code.
Create publish channel and map the publish channel data into a json string using json mapping application. Maximo can send data in json format to an external system.
You can also fetch data from an external system using's invokeEndpoint method and process data and call a publish channel from script. The publish channel can be json mapped to send data in json format. So, you can basically create a logic to send and receive data from maximo.
Maximo has all the possible ways to integrate with external system.
I have attached a script for you to refer. It runs a logic to get multiassetloci data and send a message out of maximo for each assetloci. It is not perfect but a good example to send ,receive and process data.
------------------------------
Biplab Choudhury
Maximo Consultant
Tata Consultancy Services
Melbourne
Original Message:
Sent: Tue June 23, 2020 07:44 PM
From: Appu Nair
Subject: Open a External Website with Params from Maximo
@Steven Shull That piece of advice was very good. Currently, I am able to call my external REST API through my automation script :)
I was able to do many things in this blog https://bportaluri.com/2018/08/maximo-call-external-rest-api-sms.html but far from out of the woods
I have not found a way to trap the RESPONSE which comes like this from my logger
[6/23/20 23:28:03:267 UTC] 000006d5 SystemOut O 23 Jun 2020 23:28:03:267 [DEBUG] [MAXIMO] [] nSending 'POST' request to URL : MASKED
[6/23/20 23:28:03:267 UTC] 000006d5 SystemOut O 23 Jun 2020 23:28:03:267 [DEBUG] [MAXIMO] [] Post Data : {"userName":"MASKED","password":"MASKED"}
[6/23/20 23:28:03:267 UTC] 000006d5 SystemOut O 23 Jun 2020 23:28:03:267 [DEBUG] [MAXIMO] [] Response Code :
[6/23/20 23:28:03:267 UTC] 000006d5 SystemOut O 23 Jun 2020 23:28:03:267 [DEBUG] [MAXIMO] [] 200
[6/23/20 23:28:03:267 UTC] 000006d5 SystemOut O 23 Jun 2020 23:28:03:267 [DEBUG] [MAXIMO] [] {"token":"6F7464735F73657373696F6E5F6B6579",
"userId":"MASKED",
"ticket":"*RFA",
"resourceID":null,"failureReason":null,"passwordExpirationTime":0,"continuation":false,"continuationContext":null,"continuationData":null}
My intention is to find the individual tuples in the TEXT that is being logged out. In POSTman it comes as JSON I am printing that lines
br = BufferedReader(InputStreamReader(conn.getInputStream())) (I belive I took this from Bruno's site)
authResp = br.readLine()
the authResp is what I am printing in my logger
Hopefully, the IBM Maximo JSON API has easy ways to extract them
------------------------------
Appu Nair
Original Message:
Sent: Tue June 23, 2020 09:48 AM
From: Steven Shull
Subject: Open a External Website with Params from Maximo
When you create the signature option for a push button automation script, it's slightly different than a launch in context. In the Advanced Signature Options, ensure that you have the radio selected for "This is an action that must be invoked by user in the UI".
Beyond that, invoking an endpoint won't record anything when it is successful. You would need to do that yourself if you need to indicate that to the user. If it failed for some reason (such as connection refused, certificate issue, etc.) an error would be thrown (assuming the script is firing). If you want to be sure that a request was invoked you can turn the integration logger to debug (inside of the logging application, ensuring that it is also checked as active) and it will show the details of the endpoint being invoked.
------------------------------
Steven Shull
Director of Development
Projetech Inc
Cincinnati OH
Original Message:
Sent: Tue June 23, 2020 09:32 AM
From: Appu Nair
Subject: Open a External Website with Params from Maximo
@Steven Shull @Anamitra Bhattacharyya
- Action Launch Point Script called Launch2 created Language Jython in Automation Script Tab, No Variables in Variables Tab, Launch Points has Launch Point Type like this
- I created a Tab in Asset Application , I added a Section, Inside there I added a "Push Button" .in the Push Button properties in Advanced I have a signature created called Launch2. Going by that in its General I have the Label as Launch2 and Event as LAUNCH2.I do not know what Default Button is so I clicked it and tried without clicking it.
- I went and added Launch2 as possible for maxadmin group as this is a pre production system and I only have this user.Logged out.
- An HTTP endpoint called APPUHTTP with URL of google made in the Integration Application
- in my Automation script that I am caling Launch2 here is the code in jython
from java.util import HashMap
map = HashMap()
map.put("URL","https://www.google.com/")
service.invokeEndpoint("APPUHTTP",map,"appu")
I open up an asset record. My Pushbutton shows . Clicking it produces no difference I see no messages of error
Nothing to say any script was called. The script is set to DEBUG as well.
------------------------------
Appu Nair
Original Message:
Sent: Tue June 23, 2020 08:09 AM
From: Steven Shull
Subject: Open a External Website with Params from Maximo
Are you trying to just make a REST API request? Since you did your testing in Postman I assume the answer is yes. The launch in context is really intended for when a user needs to interactively go to a separate application. If you just want to make a REST API request to another system, you really want to utilize end points in Maximo. If you setup an end point in the end points application with the HTTP handler, you'll be able to provide headers, URL, method (POST/GET), etc. If something is dynamic (IE you need to set it in the automation script, such as headers or the URL) then you would want to check the "Allow Override" checkbox. If you don't check the checkbox, it will be ignored if you try to provide it in the overrides.
In your script, you setup any overrides in a HashMap. Ex below (you would replace NEWURL with the URL, such as https://google.com):
from java.util import HashMap
map = HashMap()
map.put("URL","NEWURL")
Then you invoke the endpoint using:
service.invokeEndpoint("endpointname",map,body)
map corresponds to the hashmap of overrides that I talked about above. If none are required, you can provide a blank hashmap by declaring HashMap(). Body corresponds to a string of the message body that you want to send (assuming you have one to provide). Depending on the system, this could be JSON or XML or NULL entirely if not required for the request.
I've never executed code on a tab change, so I'm not sure what is possible there. I would personally recommend using an action (either in the Select Action/More Actions menu or via a push button). Tabs aren't an indicator in Maximo of an action occurring and actions should be explicit as possible. For example, what would occur if someone accidently clicked the wrong tab? Or what happens if you have a read-only account that needs to be able to see data on that tab?
Your two examples are both java examples, but could be adjusted to work with an automation script action launch point. Based on what I think you're trying to do though, this isn't what you want. These queue up events inside of the Maximo framework (IE go from Asset to Location application for example). They're not going to help you interact with an external system.
------------------------------
Steven Shull
Director of Development
Projetech Inc
Cincinnati OH
Original Message:
Sent: Fri June 19, 2020 08:53 AM
From: Appu Nair
Subject: Open a External Website with Params from Maximo
@Anamitra Bhattacharyya That is definitely what I need to do in reality this is what needs to happen.
- The website where I am passing the parameter is protected using its own rest api mechanisms like a REST Header which I can craft through Postman. Postman actually shows me code for several programming languages. The line you have in the sample what language is that scripting. I see maximo supports several?
- What would I need to do if the requirement is say one is on the Asset Tab and clicks the custom tab,not a hyperlink or button, could I possibly intercept the custom tab click in some way so that a "automation script" can be run.
- In this link the author says associate the code snippet with your button? https://maximomize.wordpress.com/2018/03/16/open-application-and-open-its-record-using-a-button/ or this link where the author talks about adding code https://maximonews.wordpress.com/2011/05/15/redirect-from-one-app-in-maximo-to-another/ is it part of a java class or scripting ?
------------------------------
Appu Nair
Original Message:
Sent: Fri June 19, 2020 08:20 AM
From: Anamitra Bhattacharyya
Subject: Open a External Website with Params from Maximo
Hi
You can try this solution -
1. create a button in the place where you want the user to click to launch the other web site
2. back the button up using an action - which you can script (automation script app - action launch point)
3. a sample "action launch point" automation script (1 line) for this would be below
service.openUrl(url,True)
Now you will need to manipulate the url - using the "mbo" implicit var - so that you can add the id etc to the url.
As per the security group for the sigoption for the button - make sure MAXADMIN group has access for test purpose and then let it get driven by your business requirements as to who all need to have access.
------------------------------
Anamitra Bhattacharyya
IBM
Littleton MA
Original Message:
Sent: Thu June 18, 2020 05:23 PM
From: Appu Nair
Subject: Open a External Website with Params from Maximo
Hi All,
I am relatively new to Maximo Development. My requirement is to invoke a non maximo website (another non IBM application that is accessed via a URL).I have been scouring over IBM sites as well as the most popular sites (Bruno Portaluri, Chon Neth,Viet Tran)
This article looks promising to me so I went and followed everything according to the letter,but my hyperlink is visible in Work Order Tracking application if I do not put the signature options. For sake of snity I went to the two groups MAXADMIN and
IBM Launch In Context
The forum members hopefully can see where I placed the Hyperlink in the work order application
After I save and go back and close my browser and come back as maxadmin I do not see the hyperlink so if i go to application designer and remove the signature in the advanced section of hyperlink and come back the hyperlink will be there but when i click i get a BMX error you are not authorized.
If this is not how to pass a external website can someone comment actually all I want to do is create a tab(Done) when the user moves to my tab I want it to pass the Asset(or any other id MBO) to my external application and show its representation in that application, in other words like the IFRAME examples of yesteryear like 2013 and so on . The Iframe options are throwing cross-site problems et al.
Some simple example of a script if anyone has done similar stuff.I am not afraid of doing java but again there is no quality java examples that say here is how you do it.I know by clicking on the presentation of application I see this psdi.webclient.beans.workorder.WorkorderAppBean but what I am wondering is how would one know what to extend/change in that IBM class ?surely I wouldnt probably need to do that but I just jotted it just so that I know where teh class is...
Whty is IBM Developer site bereft of any real snippets,full examples most of it will lead to IBM Community which has been retired?
------------------------------
Appu Nair
------------------------------
#MaximoIntegrationandScripting
#AssetandFacilitiesManagement
#Maximo