This should be possible using that widget https://marketplace.mendix.com/link/component/202675
(you just need to store the html response inside an attribute, then you put it in the "html source" of the widget)
you can use this widget to apply what you need.
https://docs.mendix.com/appstore/widgets/html-javascript-snippet/