copyright | lastupdated | subcollection | keywords | ||
---|---|---|---|---|---|
|
2022-05-13 |
mqcloud |
admin, administration, REST, API, SSL, TLS, explorer, discovery |
{{site.data.keyword.attribute-definition-list}}
{: #mqoc_view_swagger_docs_ibm_mq_rest_api}
Follow these instructions to view the Swagger documentation for the IBM MQ REST APIs.
This documentation is presented in Swagger formatting, and they can be viewed either through the Swagger UI or by retrieving the Swagger 2 documentation in a JSON format.
View Type | URL |
---|---|
Swagger UI | https://web-{qm-hostname}/ibm/api/explorer |
Swagger JSON | https://web-{qm-hostname}/ibm/api/docs |
{: #mqoc_access_swagger_ui}
To access the Swagger UI you will need to retrieve your admin user credentials (username and password).
-
Go to your {{site.data.keyword.mq_short}} service instance, and open the queue manager details page.
-
Go to the administration tab and click on 'MQ Explorer' tab.
-
Now click on the "Create | Reset IBM Cloud API key" button. This will generate or regenerate an admin user API key to login to your queue manager.
-
In the dialog window titled "API key successfully created", you can show or copy the key. Click "Download" to retrieve a copy of the username and API key in a json format.
-
Go back to the "Configuration" tab in the queue manager details view, and take note of the queue manager hostname. This can be found under 'Endpoints', 'Hostname'. Click the copy button to put on your clipboard.
-
Next open a new browser tab and go to
https://web-{your-qmgr-hostname}/ibm/api/explorer
-
You will be presented with a login dialog box. Input the admin username you retrieved earlier and paste the API key as the password, and press Enter.
-
You should now see the Swagger UI documentation for IBM MQ REST APIs.
{: #mqoc_download_swagger_docs}
To retrieve the Swagger documentation in a JSON format instead, visit the/ibm/api/docs
endpoint instead. To access this endpoint via a web browser you must first login to /ibm/api/explorer
first and then visit /ibm/api/docs
to retrieve the JSON documentation.
To do this via cURL, follow these instructions.
- Retrieve the cookie from the
/ibm/api/explorer
endpoint
curl -k https://web-{your-qmgr-hostname}/ibm/api/explorer/ -c cookiejar.txt
{: pre}
- Then send a request to the
/ibm/api/docs
endpoint supplying the cookie
curl -k https://web-{your-qmgr-hostname}/ibm/api/docs -b cookiejar.txt > api-docs.json
{: pre}
Congratulations, you have successfully viewed and retrieved the REST API documentation for your {{site.data.keyword.mq_full}} queue manager.