GET

Use the HTTP GET method with the channel resource to request information about channels.

Note:
  • This resource URL is available only in version 1 of the REST API. To query channels using version 2 of the REST API, use the /admin/action/qmgr/{qmgrName}/mqsc resource.
  • [MQ 9.3.5 Feb 2024]This resource is not available in a stand-alone IBM® MQ Web Server installation. For more information about the installation options for the IBM MQ component that runs the administrative REST API, see The IBM MQ Console and REST API.

The information that is returned is similar to the information returned by the MQCMD_INQUIRE_CHANNEL (Inquire Channel) and MQCMD_INQUIRE_CHANNEL_STATUS (Inquire Channel Status) PCF commands, and the DISPLAY CHANNEL (display channel definition) and DISPLAY CHSTATUS (display channel status) MQSC commands.

[z/OS]Note: On z/OS®, the channel initiator must be running before you use the channel resource with the HTTP GET method specifying the status parameter.
Note: The REST API supports only the following channels:
  • Channels that have a transport type of TCP.
  • Sender, receiver, server, requester, cluster-sender, and cluster-receiver channels.

Other channels are not returned.

Resource URL

https://host:port/ibmmq/rest/v1/admin/qmgr/{qmgrName}/channel/{channelName}

qmgrName
Specifies the name of the queue manager on which to query the channels.
You can specify a remote queue manager as the qmgrName. If you specify a remote queue manager, you must configure a gateway queue manager. For more information, see Remote administration using the REST API.
The queue manager name is case-sensitive.
If the queue manager name includes a forward slash, a period, or a percent sign, these characters must be URL encoded:
  • A forward slash (/) must be encoded as %2F.
  • A percent sign (%) must be encoded as %25.
  • A period (.) must be encoded as %2E.
channelName
Optionally specifies the name of a channel to query. This channel must exist on the specified queue manager.
The channel name is case-sensitive.
If the channel name includes a forward slash or a percent sign, these characters must be URL encoded:
  • A forward slash, /, must be encoded as %2F.
  • A percent sign, %, must be encoded as %25.

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

Optional query parameters

attributes={object,...|*|object.attributeName,...}
object,...
Specifies a comma-separated list of JSON objects that contain related channel configuration attributes to return.
For example, to return all channel configuration attributes that are related to time stamps, specify timestamps. To return all channel configuration attributes that are related to compression and to connection management, specify compression,connectionManagement.
The status objects cannot be specified with this query parameter. Use the status query parameter to return these attributes.
You cannot specify the same object more than once. If you request objects that are not valid for a particular channel, the attributes are not returned for that channel. However, if you specify a value for the type parameter that is not all, and request objects that are not valid for that channel type, an error is returned.
For a full list of objects and associated attributes, see Attributes for channels.
*
Specifies all attributes.
object.attributeName,...
Specifies a comma-separated list of channel configuration attributes to return.
Each attribute must specify the JSON object that contains the attribute, in the form object.attributeName. For example, to return the keepAliveInterval attribute, which is contained in the connectionManagement object, specify connectionManagement.keepAliveInterval.
Attributes can be nested inside multiple JSON objects, such as exits.message.name, which is an attribute inside a message object inside an exits object.
The keyword [type] can be used as a wildcard to include multiple channel-type-specific sections that contain the same attribute. For example, [type].clusterName is equivalent to clusterSender.clusterName,clusterReceiver.clusterName.
Attributes from the status object cannot be specified with this query parameter. Use the status query parameter to return these attributes.
You cannot specify the same attribute more than once. If you request attributes that are not valid for a particular channel, the attributes are not returned for that channel. However, if you specify the type parameter and request attributes that are not valid for that channel type, an error is returned.
For a full list of attributes and associated objects, see Attributes for channels.
status={*|currentStatus|savedStatus|currentStatus.attributeName,savedStatus.attributeName,...}
*
Specifies that all savedStatus and currentStatus attributes are returned.
currentStatus
Specifies that all currentStatus attributes are returned.
savedStatus
Specifies that all savedStatus attributes are returned.
currentStatus.attributeName,savedStatus.attributeName,...
Specifies a comma-separated list of current status and saved status attributes to return.
For example, to return the state attribute, specify currentStatus.state.
For a full list of status attributes, see Current status attributes for channels and Saved status attributes for channels.
filter=filterValue
Specifies a filter for the channel definitions that are returned.
If you specify a channel name in the resource URL, you can only filter on status attributes.
If you filter on a current status attribute, the only current status objects returned are those that match the filter parameter. All saved status objects for the corresponding channels are returned, if requested.
If you filter on a saved status attribute, the only saved status objects returned are those that match the filter parameter. All current status objects for the corresponding channels are returned, if requested.
You can specify only one filter. If you filter on a status attribute, you must specify the corresponding status query parameter.
filterValue has the following format:
attribute:operator:value
where:
attribute
Specifies one of the applicable attributes. For a full list of attributes, see Attributes for channels. The following attributes cannot be specified:
  • name
  • type
  • [z/OS]queueSharingGroup.disposition
  • [type].connection.port
  • connectionManagement.localAddress.port
  • connectionManagement.localAddress.portRange
  • currentStatus.general.connection.port
  • currentStatus.connectionManagement.localAddress.port
The keyword [type] can be used as a wildcard to include multiple channel-type-specific sections that contain the same attribute, such as sender.connection and clusterReceiver.connection.
To filter on any attributes that are time stamps, the filter can specify any portion of the time stamp, with a trailing asterisk, *. The format of a time stamp is, YYYY-MM-DDThh:mm:ss. For example, you can specify 2001-11-1* to filter on dates in the range 2001-11-10 to 2001-11-19, or 2001-11-12T14:* to filter any minute in the specified hour of the specified day.
Valid values for the YYYY section of the date are in the range 1900 - 9999.
The time stamp is a string. Therefore, only the equalTo and notEqualTo operators can be used with the time stamp.
operator
Specifies one of the following operators:
lessThan
Use this operator only with integer attributes.
greaterThan
Use this operator only with integer attributes.
equalTo
Use this operator with any attribute except string array attributes and integer array attributes.
notEqualTo
Use this operator with any attribute except string array attributes and integer array attributes.
lessThanOrEqualTo
Use this operator only with integer attributes.
greaterThanOrEqualTo
Use this operator only with integer attributes.
contains
Use this operator only with integer array attributes and string array attributes.
doesNotContain
Use this operator only with integer array attributes and string array attributes.
value
Specifies the constant value to test against the attribute.
The value type is determined by the attribute type.
For string and boolean attributes, you can omit the value field after the colon. For string attributes, omit the value to return channels with no value for the specified attribute. For boolean attributes, omit the value to return any channels that have the specified attribute set to false. For example, the following filter returns all channels where the description attribute is not specified:
filter=general.description:equalTo:
You can use a single asterisk, *, at the end of the value as a wildcard. You cannot use only an asterisk.
If the value includes a space, a forward slash, a percent sign, or an asterisk that is not a wildcard, these characters must be URL encoded:
  • A space must be encoded as %20
  • A plus, +, must be encoded as %2B
  • A forward slash, /, must be encoded as %2F.
  • A percent sign, %, must be encoded as %25.
  • An asterisk, *, must be encoded as %2A.
name=name
This query parameter cannot be used if you specify a channel name in the resource URL.
Specifies a wildcard channel name to filter on.
The name specified must include an asterisk, *, as a wildcard. You can specify one of the following combinations:
*
Specifies that all channels are returned.
prefix*
Specifies that all channels with the specified prefix in the channel name are returned.
*suffix
Specified that all channels with the specified suffix in the channel name are returned.
prefix*suffix
Specifies that all channels with the specified prefix and the specified suffix in the channel name are returned.
type=type
Specifies the type of channel to return information about.
The value can be one of the following values:
all
Specifies that information about all channels is returned.
sender
Specifies that information about sender channels is returned.
receiver
Specifies that information about receiver channels is returned.
server
Specifies that information about server channels is returned.
requester
Specifies that information about requester channels is returned.
clusterSender
Specifies that information about cluster sender channels is returned.
clusterReceiver
Specifies that information about cluster receiver channels is returned.
The default value is all.
queueSharingGroupDisposition=disposition
[z/OS]This parameter is only available on z/OS.
Specifies the disposition of the channels for which information is to be returned.
The value can be one of the following values:
live
Return channels defined with qmgr or copy disposition.
all
Return channels defined with qmgr, copy or group disposition.
copy
Return channels defined with copy disposition.
group
Return channels defined with group disposition.
private
Return channels defined with copy or qmgr disposition.
qmgr
Return channels defined with qmgr disposition.
The default value is live.

Request headers

The following headers must be sent with the request:
Authorization
This header must be sent if you are using basic authentication. For more information, see Using HTTP basic authentication with the REST API.
The following headers can optionally be sent with the request:
ibm-mq-rest-gateway-qmgr
This header specifies the queue manager that is to be used as the gateway queue manager. The gateway queue manager is used to connect to a remote queue manager. For more information, see Remote administration using the REST API.

Request body format

None.

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.

If token based security is used, the LTPA token that is used to authenticate the user must be provided with the request as a cookie. For more information about token-based authentication, see Using token-based authentication with the REST API.

The security principal of the caller must be granted the ability to issue the following PCF commands for the specified queue manager:
  • If the status query parameter is not specified:
    • For the channel that is specified by the {channelName} portion of the resource URL, or for channels that match the specified query parameters, authority to issue the MQCMD_INQUIRE_CHANNEL PCF command must be granted.
  • If the status query parameter is specified:
    • For the channel that is specified by the {channelName} portion of the resource URL, or for channels that match the specified query parameters, authority to issue the MQCMD_INQUIRE_CHANNEL PCF command must be granted.
    • For the channel that is specified by the {channelName} portion of the resource URL, or for channels that match the specified query parameters, authority to issue the MQCMD_INQUIRE_CHSTATUS PCF command must be granted.
A principal has display authority if the principal can issue one or both of the MQCMD_INQUIRE_CHANNEL and MQCMD_INQUIRE_CHSTATUS PCF commands. If the principal has display authority for only some of the channels that are specified by the resource URL and query parameters, then the array of channels that is returned from the REST request is limited to those channels that the principal has authority to display. No information is returned about channels that cannot be displayed. If the principal does not have display authority for any of the channels that are specified by the resource URL and query parameters, an HTTP status code of 403 is returned.

[UNIX, Linux, Windows, IBM i]On Multiplatforms, if the attribute currentStatus.monitoring.messagesAvailable is to be returned, authority to issue the MQCMD_INQUIRE_Q on the transmission queues used by cluster sender channels is required.

[AIX, Linux, Windows]On AIX®, Linux®, and Windows, you can grant authority to security principals to use IBM MQ resources by using the setmqaut command. For more information, see setmqaut (grant or revoke authority).

[z/OS]On z/OS, see Setting up security on z/OS.

Response status codes

200
Channel information retrieved successfully.
400
Invalid data provided.
For example, invalid channel attributes specified.
401
Not authenticated.
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, see Security requirements.
403
Access prohibited for one of the following reasons:
  • Not authorized. The caller is authenticated to the mqweb server and is associated with a valid principal. However, the principal does not have access to the required IBM MQ resources. For more information about the access that is required, see Security requirements.
  • [MQ 9.3.5 Feb 2024]Access prohibited in the current server environment. The administrative REST API is not available in a stand-alone IBM MQ Web Server installation.
404
Channel does not exist.
500
Server issue or error code from IBM MQ.
503
Queue manager not running.

Response headers

The following headers are returned with the response:
Content-Type
This header is returned with a value of application/json;charset=utf-8.
ibm-mq-rest-gateway-qmgr
This header is returned if a remote queue manager is specified in the resource URL. The value of this header is the name of the queue manager that is used as the gateway queue manager.

Response body format

The response is in JSON format in UTF-8 encoding. The response contains an outer JSON object that contains a single JSON array called channel. Each element in the array is a JSON object that represents information about a channel. Each of these JSON objects contains the following attributes:

name
String.
Specifies the name of the channel.
This attribute is always returned.
type
String.
Specifies the type of channel.
The value is one of the following values:
  • sender
  • receiver
  • server
  • requester
  • clusterSender
  • clusterReceiver
This attribute is always returned.

The following objects can be included in the JSON object that represents information about a channel. Which objects and attributes are returned depends on the URL that was specified for the request:

sender
Contains attributes that are related to sender channels.
server
Contains attributes that are related to server channels.
requester
Contains attributes that are related to requester channels.
clusterSender
Contains attributes that are related to cluster sender channels.
clusterReceiver
Contains attributes that are related to cluster receiver channels.
clusterRouting
Contains attributes that are related to the routing of messages in a cluster.
connectionManagement
Contains attributes that are related to connection management including:
  • A JSON array of connection objects that are labeled connectionManagement, which contain host and port information
  • longRetry and shortRetry objects, containing count and interval attributes
compression
Contains attributes that are related to compression
dataCollection
Contains attributes that are related to monitoring and statistics
exits
Contains exit objects and arrays of exit objects, each containing:
  • Exit name attribute
  • User data attribute
extended
Contains attributes that are related to extended channel properties, such as data conversion, and sequence numbers.
failedDelivery
Contains attributes that are related to message delivery failure, such as retry options.
general
Contains attributes that are related to general channel properties, such as the description of the channel.
batch
Contains attributes that are related to message batches.
queueSharingGroup
Contains attributes that are related to queue sharing groups on z/OS.
receiverSecurity
Contains attributes that are related to security for receiving channels.
transmissionSecurity
Contains attributes that are related to transmission security and encryption.
For more information, see Response body attributes for channels.

If a damaged object is found, and the REST request did not specify a channel name within the resource URL, an extra JSON array that is called damaged is returned. This JSON array contains a list of the objects that are damaged, specifying the object names. If the REST request specifies a channel name within the resource URL, but the object is damaged, an error is returned.

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

Examples

  • The following example lists all channels on the queue manager QM1. The following URL is used with the HTTP GET method:
    https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/channel
    The following JSON response is returned:
    {
        "channel": 
        [{
            "name": "RECEIVER.CHL",
            "type": "receiver"
        }, {
            "name": "SENDER.CHL",
            "type": "sender",
            "sender": {         
                "connection": [{
                    "host":"example.com",
                    "port": "1414"
                }],
                "transmissionQueueName": "XMIT.Q"
            }
        }, {
            "name": "SERVER.CHL",
            "type": "server",
            "server": {      
                "transmissionQueueName": "XMIT.Q" 
            }
        }, {
            "name": "REQUESTER.CHL",
            "type": "requester",
            "requester": {      
                "connection": [{
                    "host": "example.com",
                    "port": 1414
                }]
            }
        }, {
            "name": "CLUSSDR.CHL",
            "type": "clusterSender",
            "clusterSender": {    
                "connection": [{
                    "host": "example.com",
                    "port": 1414
                }],
                "clusterName": "CUSTER1"
            }
        }, {
            "name": "CLUSRCVR.CHL",
            "type": "clusterReceiver",
            "clusterReceiver": {        
                "connection": [{
                    "host": "example.com",
                    "port": 1414
                }],
                "clusterName": "CUSTER1"
            }
        }]
    }
  • The following example lists all receiver channels on the queue manager QM1, showing their connection retry attempts information. The following URL is used with the HTTP GET method:
    https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QMGR2/channel?type=sender&attributes=connectionManagement.shortRetry,connectionManagement.longRetry
    The following JSON response is returned:
    {
        "channel": 
        [{
            "name": "SENDER.CHL",
            "type": "sender",
            "connectionManagement": {
                "longRetry": {
                    "count": 999999999,
                    "interval": 1200
                },
                "shortRetry": {
                    "count": 10,
                    "interval": 60
                }
            },
            "sender": {
                "connection": [{
                    "host": "example.com",
                    "port": 1414
                }],
                "transmissionQueueName": "XMIT.Q"
        }, {
            "name": "SYSTEM.DEF.SENDER",
            "type": "sender",
            "connectionManagement": {
                "longRetry": {
                    "count": 999999999,
                    "interval": 1200
                },
                "shortRetry": {
                    "count": 10,
                    "interval": 60
                }
            },
            "sender": {
                "connection": [],
                "transmissionQueueName": ""
        }]
    }
  • The following example lists some status attributes for the channel CHL1, on channel manager QM1. The following URL is used with the HTTP GET method:
    https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/channel/CHL1?status=currentStatus.timestamps,currentStatus.batch.currentMessages,savedStatus.batch.currentMessages
    The following JSON response is returned:
    {
    	"channel": 
    	[{
    		"name": "CHL1",
    		"type": "sender",
    		"currentStatus": [{
    		    "inDoubt": false,
    			"state": "running",
    			"batch": {
    		        "currentMessages": 10
    		    },
    			"timestamps": {
    				"lastMessage": "2017-10-02T09:17:42.314Z",
    				"started": "1993-12-31T23:59:59.000Z"
    			}
    		}],
    		"savedStatus": [{
    		    "inDoubt": false,
    		    "batch": {
    		        "currentMessages": 5
    		    }
    		}, {
    		    "inDoubt": false,
    		    "batch": {
    		        "currentMessages": 7
    		    }
    		}]
    	}]
    }
  • The following example shows how to get all information, including current status and saved status, for the channel CHL2 on queue manager QM1. The following URL is used with the HTTP GET method:

    https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/channel/CHL2?attributes=*&status=*
  • The following example shows how to get all channel configuration and status information for channels that are currently running, for the queue manager QM1. The following URL is used with the HTTP GET method:

    https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/channel?attributes=*&status=*&filter=currentStatus.state:equalTo:running