curl --request GET \ --url 'https://softwaresolutions.mantishub.io/api/rest/issues?filter_id=unassigned' \ --header 'Authorization:h58meqhpRzLfnGRf6Pu8FA8thjWGvBFd'
At MantisHub we have been working for a while on the new modern REST API for remotely accessing MantisHub data and configuration. We now feel that we have enough coverage of MantisHub functionality to encourage our users to switch to it. The API can provide a great way to integrate MantisHub into your build system, IDEs, test management systems, other SaaS applications, or your own applications.
Tools for using the API
Similar to what you expect from any REST API, you should be able to easily leverage it from your preferred language and platform. You can get the documentation for the API from our API documentation. The API is published via Postman API network enabling you to easily download Postman definitions for the API and start hacking away. If you don’t already have Postman, you can download it from Postman website. For command line access to MantisHub, we developed PowerShell module which can be used from Windows, Mac or Linux. You can also use curl which is available by default for Mac and Linux.
For accessing the API you will need to authenticate, and for this you will need to generate a secure API token from within your MantisHub rather than passing username password. Instructions for generating a token can be found in our KB article here. Remember to record your generated token since it will only be displayed on generation and once you exit out you won’t be able to get it again. You should, of course, have separate tokens for each of your integrations which provides you with the ability to manage each integration independently and associate such integrations with appropriate users or system accounts in your system (e.g. a build user account).
Individual users, as well as administrators, can generate tokens so make sure the user has access to the functionality needed for the integration. For example, if a token is generated for user Bob who is a reporter for Project X and you run an API call using the token to update an existing issue or delete it, the call will fail. The only time you won’t need a token is if you have anonymous access enabled for your MantisHub and the integration only requires read-only access.
API endpoint and Resources
The Endpoint for your API will be
Following are examples of API capabilities around entities defined in MantisHub:
- Issues – Retrieve one issue, retrieve issues matching a filter, create, delete or update issues, add notes, tags, relationships, attachments, etc.
- Projects – Get a full list of all projects accessible to logged in user along with project specific configuration like categories, versions, custom fields, etc.
- Filters – Retrieve all filters definitions, a single filter definition, or delete filters.
- Users – Create or delete users or retrieve your user information.
- Configuration – Retrieve one or many configuration options.
- Localized Strings – Retrieve one or many Local Strings.
The API library is still growing so be sure to refer to the documentation for the most up-to-date API definitions.
MantisHub has a wide range of features and customizations that allow you to get the cover most of your software bug tracking and general issue tracking needs. We also provide a number of plugins and integrations including chat apps Slack and Hipchat, Source control integrations with GitHub and Bitbucket, JetBrains, TestLodge for test case management and more. And now with the REST API… your options just got even bigger!
**MantisHub’s previously supported SOAP API is now on the deprecation path in favor of the REST API.
Some of you Mantis users out there are most likely in need or already using a test case management tool to pickup any bugs in your software product. You may be thinking “How useful would it be to have my issue tracker and test case manager work together!” Well there are a number of test case managers out there that do advertise integration with Mantis and their instruction are available for you to test out.
MantisHub team is currently working on testing some of these out for you but if you’re after tried and true, we’ve been working with our friends at TestLodge and have developed step by step instructions to allow you to integrate MantisHub with their popular test case managment tool. Known for its clean and simple interface (sound familiar? 😉 you can starting running through test cases straight away. Linked with your clean and simple MantisHub service, this can save you a heap of time.
It’s really easy to setup the integration, you can check out our knowledge base article for the full procedure and functionality details. TestLodge have even produced a short video tutorial to help get you going that you can find linked in our article.
With the TestLodge integration you can connect to your MantisHub service using an easily generated, secure API token. We recommend you create a new, appropriately named user within MantisHub to use for linking to TestLodge so it’s easy to identify TestLodge generated issues. Once linked, you can automatically create issues with MantisHub when tests cases fail. You can setup within TestLodge the MantisHub project that you want these issues to be created in and also set the MantisHub issue’s assigned user, category, priority and severity all from within TestLodge. There’s even the capability to pull status updates on MantisHub issues via API and re-run tests based on the current issues status (e.g. resolved).
Our friends at TestLodge are offering a great deal to all MantisHub users, sign up for a free TestLodge trial and integrate it with your MantisHub service and they’ll give you a 10% discount on your TestLodge subscription. Reach out to their team at help.testlodge.com quoting the coupon Mantis10 before your free trial ends to receive this offer.
Pair MantisHub’s intuitive powerful tracker with this popular and efficient test case manager to even further simplify your software project delivery process.
MantisHub provides several possibilities for connecting with other systems. Whether it is through email reporting, CSV import/export, or through its API. Among these, the API is the most powerful and automation-friendly way to extend MantisHub.
So if you are a developer, the API will enable you to create great end-to-end scenarios. Whether it is to auto-create issues for build failures, crashes in production, or sending daily reports based on pre-defined filters.
To make this easier, we have created client libraries that provides an easy way to leverage the API. We’ve open sourced these libraries and made them available through our github organization.
Since MantisHub API is SOAP based webservice, it is also easy to auto-generate proxy clients for any language using the appropriate language specific tool chain.
So whatever integration or automation scenario you have in mind, checkout out our API.
The possibilities are endless…
API tokens provide users with more control, convenience, visibility and security when providing other services and apps access to their MantisHub.
Here are some of the benefits of API tokens compared to use of passwords:
- Tokens are 32 characters long and cryptographically secure, hence, they are much more secure than user passwords.
- Tokens are generated by MantisHub, hence, they are not going to be shared passwords with any other internet services that the users use.
- Users have visibility on when each token was last used to access MantisHub.
- Users can revoke one of the tokens without impacting others. Hence, can selectively deny access to specific services.
- Users can change their passwords without affecting the validity of the API tokens.
Users can generate API tokens via their My Account – API tokens. The tokens are only displayed once and should be used for one integration. The tokens can be passed in the password field when calling the MantisHub SOAP APIs. Note that it can’t be used to login via the MantisHub login page.