Simple Mantis JSON API

Mantis has a SOAP API, but I wanted JSON to display the most recent tickets on a web page using JavaScript. Hence I wrote a simple wrapper in PHP that does a SOAP call and returns the result as JSON to be conveniently digested by JavaScript.

Put the mantisconnect_json.php file wherever you want, it doesn’t need to be on the same server or have the same domain as the Mantis installation. Edit the MANTISCONNECT_URL and your Mantis username and password.

The query string parameter name defines what SOAP action to call, the rest of the query string parameters are passed as arguments in the SOAP call. Note that the Mantis username/password is inserted automatically as arguments by the PHP code to avoid having you expose it publicly in JavaScript (but they may be overridden if desired).

Please note that this is a very simple wrapper for read-only purpose (e.g. it will not work to create new issues).