The second part of the URI must be sub to call the SubController.


Get information about one or more subscriptions. This action executes the MQCMD_INQUIRE_SUB pcf command. On success, the returned JSON object will have a data array, on failure an error object.

URL Parameters



The name of the queuemanager. This parameter is required.


The unique identifier of the application for a subscription. A generic value is allowed. This parameter is optional.

Query Parameters


Specifies how the command is executed when the queuemanager is a member of a queue-sharing group. This parameter applies to z/OS only.


Restrict the type of subscriptions by specifying Yes, No or All. The value is case sensitive.


When value is true, all subscriptions starting with SYSTEM. will be discarded. This parameter is optional. By default the value is set to false.


Speficies which filter to use: I means Integerfilter, S means Stringfilter. FilterParam and FilterValue are required to create the filter. When a filter can’t be build because of too little information, it will be silently discarded.


The operator that is being used to evaluate whether the parameter satisfies the filter-value. The default is EQ.

The following values are allowed:

A Stringfilter can use some additional operators:


The name of the parameter to filter on. The names are based on the names used in the WebSphere MQ information center.


The value to use for filtering. When a string is passed for an Integerfilter, a WebSphere MQ constant is assumed.


With the SubAttrs parameter you can specify which attributes must be returned from the PCF command. Multiple occurences of this parameter are possible. The value must be a valid attribute name.

Attrs is a synonym for SubAttrs


Specifies the unique internal subscription identifier. This parameter is optional and can’t be used together with SubName.


The unique identifier of the application for a subscription. A generic value is allowed. This parameter is optional and can’t be used together with SubId.

This parameter is ignored when there is a URI parameter for a SubName.


Only return the subscriptions of the given type. Possible values are Admin, API, Proxy, User or All. Default is All. The value is case-sensitive.



This sample is a PHP script that inquires all subscriptions from a queuemanager:

 * This sample will show all subscriptions from a queuemanager.
 * MQWeb runs on localhost and is listening on port 8081. 
if ( count($argv) < 2 ) {
	echo 'Please pass a queuemanager name as argument', PHP_EOL;

$qmgr = $argv[1];

$url = 'http://localhost:8081/api/sub/inquire/' . $qmgr . '/*';

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

if ( ($response = curl_exec($curl)) === false )	{
	$err = curl_error($curl);
	echo 'An HTTP error occurred while getting subscription information from '
		, $qmgr
		, ': '
		, $err
		, PHP_EOL;
else {
	$json = json_decode($response);
	// When there is an error object returned, something went wrong with
	// the WebSphere MQ command.
	if ( isset($json->error) ) {
		echo 'An MQ error occurred while inquiring subscriptions from '
			, $qmgr
			, PHP_EOL;
		echo 'Reason Code: '
			,	$json->error->reason->code
			, " - "
			, $json->error->reason->desc
			, PHP_EOL;
	else {
		echo 'Subscriptions on ', $qmgr, PHP_EOL;
		echo '-----------------', str_repeat('-', strlen($qmgr)), PHP_EOL;
		if ( isset($json->data) && count($json->data) > 0 ) {
			foreach($json->data as $sub)
				echo $sub->SubName->value, PHP_EOL;
			echo 'No subscriptions found', PHP_EOL;

JSON Object

When using an application/json POST request you can post a JSON object with names like the query parameters.

All URL parameters and query parameters are ignored except for the URL parameter for the name of the queuemanager.

      'SubName' : 'T*',
      'SubAttrs' : [

There are some differences between query parameters and a JSON object:

An IntegerFilterCommand can’t be used together with a StringFilterCommand

This sample is a Perl script that inquires all subscriptions:

use strict;
use warnings;
use feature qw(say);

use JSON;
use LWP::UserAgent;
use HTTP::Request::Common;

# This sample will show all subscriptions from the given queuemanager.

my $qmgr = shift;
die("Please pass me the name of a queuemanager as argument") 
	unless defined($qmgr);

my $json = JSON->new;

my %input = ( 
	'SubName' => '*'
my $content = $json->encode(\%input);    

my $ua = LWP::UserAgent->new;
my $req = POST 'http://localhost:8081/api/sub/inquire/' . $qmgr;
	'Content-Type' => 'application/json',
	'Content-length' => length($content)

my $res = $ua->request($req);
die $res->status_line unless $res->is_success;
my $mqweb = $json->decode($res->content());
if ( exists($mqweb->{error}) ) {
	say 'An MQ error occurred while inquiring subscriptions.';
	say 'Reason Code: '
		, $mqweb->{error}->{reason}->{code}
		, ' - '
		, $mqweb->{error}->{reason}->{desc};
else {
	foreach my $sub(@{$mqweb->{data}}) {
		say $sub->{SubName}->{value};