+

Search Tips | Advanced Search

POST

Use the HTTP POST method with this resource to submit administrative commands directly to a queue manager.

We can use this REST API command with HTTP to run any MQSC command that is not part of the administrative REST API.

On UNIX, Linux , and Windows, this REST API command is similar to the Escape PCF command.

On z/OSĀ®, this REST API command is similar to submitting commands directly to the command server:

This REST API is deliberately lightweight in approach. Commands are submitted to the specified queue manager and the results are returned in an unprocessed format. For examples of this format, see the Example - z/OS section.


Resource URL

Version 9.0.4 and later:
https://host:port/ibmmq/rest/v1/admin/action/qmgr/qmgrName/mqsc

We can use HTTP instead of HTTPS if you enable HTTP connections. For more information about enabling HTTP, see Configure HTTP and HTTPS ports.


Request headers

The following headers must be sent with the request:


Request body format

The request body must be in JSON format in UTF-8 encoding. Within the request body attributes are defined, and named JSON objects are created to specify extra attributes. Any attributes that are not specified use the default value.

The following attributes can be included in the request body:


Security requirements

The caller must be authenticated to the mqweb server and must be a member of one or more of the MQWebAdmin, MQWebAdminRO, or MQWebUser roles. For more information about security for the administrative REST API, see IBM MQ Console and REST API security.

The security principal of the caller must be granted the ability to issue such MQSC commands against the specified queue manager as they specify.

On UNIX, Linux, and Windows, we can grant authority to security principals to use IBM MQ resources by using the mqsetaut command. For more information, see mqsetaut.

On z/OS, see Set up security on z/OS.


Response status codes


Response headers

None.


Response body format

If an error occurs, the response body contains an error message. For more information, see REST API error handling.

The format of the response body is standardized, with a consistent JSON schema. However, the content is platform-dependent, reflecting the underlying mechanism for executing MQSC commands.

The response body has the following JSON structure:
{
  "commandResponse" : [
    {
      "completionCode" : number,
      "reasonCode" :  number,
      "text" : [
        "string",
        ...
        ]
    },
    ...
  ]
  "overallCompletionCode" : number,
  "overAllReasonCode" :  number
}
The fields in the response have the following meanings:


Example - z/OS

The following sequence shows how to create a new server-connection channel that is called NEWSVRCONN on a z/OS queue manager - our example queue manager is called QM21.


Example - UNIX, Linux, and Windows

The following sequence shows how to create a new server-connection channel that is called NEWSVRCONN on UNIX, Linux, and Windows queue managers - our example queue manager is called QM_T1.