Skip to content

Subscription Information API

This API documentation provides information on operations related to viewing MQTT client subscription information, including retrieving all subscription information and retrieving all subscription information for a specific client.

Get All Subscription Information

Retrieve all subscription information within the cluster, with support for pagination.

URI

GET /subscriptions

Request Message

Query Parameters:

NameTypeDescription
_pageIntegerPage number
_limitIntegerNumber of data entries per page
clientidStringClient identifier
qosIntegerCan take values: 0, 1, 2
shareStringGroup name for shared subscriptions
_match_topicStringTopic for matching query

Response Message

NameTypeDescription
codeInteger0
dataArray of ObjectsAll subscription information
data[].nodeStringNode name
data[].clientidStringClient identifier
data[].topicStringSubscribed topic
data[].qosIntegerQoS level
metaObjectPagination information
meta.pageIntegerPage number
meta.limitIntegerNumber of data entries per page
meta.countIntegerTotal data entries

Request Example

bash
$ curl -u app_id:app_secret -X GET {api}/subscriptions

Response Example

json
{
  "meta": {
    "page": 1,
    "limit": 10000,
    "hasnext": false,
    "count": 1
  },
  "data": [
    {
      "topic": "topic/a",
      "qos": 0,
      "node": "emqx@10.12.50.91",
      "clientid": "emqx_c_1"
    }
  ],
  "code": 0
}

Get All Subscriptions for a Specific Client

URI

GET /subscriptions/{clientid}

Request Message

Query Parameters:

NameTypeDescription
clientidStringclientid

Response Message

NameTypeDescription
codeInteger0
dataArray of ObjectsAll subscription information
data[].nodeStringNode name
data[].clientidStringClient identifier
data[].topicStringSubscribed topic
data[].qosIntegerQoS level

Request Example

bash
$ curl -u app_id:app_secret -X GET {api}/subscriptions/{clientid}

Response Example

json
{
  "data": [
    {
      "topic": "testtopic/#",
      "qos": 0,
      "node": "emqx@10.12.50.36",
      "clientid": "emqx_c_1"
    },
    {
      "topic": "topic/a",
      "qos": 0,
      "node": "emqx@10.12.50.36",
      "clientid": "emqx_c_1"
    }
  ],
  "code": 0
}