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 deployment, 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
dataArray of ObjectsAll subscription information
data[].nodeStringNode name
data[].clientidStringClient identifier
data[].topicStringSubscribed topic
data[].qosIntegerQoS level
nlIntegerNo Local
rapIntegerRetain as Published
rhIntegerRetain Handling
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
// HTTP status response code
200
// HTTP response body
{
  "meta": {
    "page": 1,
    "limit": 100,
    "hasnext": false,
    "count": 2
  },
  "data": [
    {
      "topic": "t/a",
      "qos": 0,
      "node": "emqx@10.12.50.91",
      "clientid": "client_1",
      "nl": 0,
      "rap": 0,
      "rh": 0,
    },
    {
      "topic": "t/b",
      "qos": 1,
      "node": "emqx@10.12.50.91",
      "clientid": "client_2",
      "nl": 0,
      "rap": 0,
      "rh": 0,
    }
  ]
}

Get All Subscriptions for a Specific Client

URI

GET /clients/{client_id}/subscriptions

Request Message

Response Message

NameTypeDescription
dataArray of ObjectsAll subscription information
data[].nodeStringNode name
data[].clientidStringClient identifier
data[].topicStringSubscribed topic
data[].qosIntegerQoS level
nlIntegerNo Local
rapIntegerRetain as Published
rhIntegerRetain Handling

Request Example

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

Response Example

json
{
  "data": [
    {
      "topic": "t/a",
      "qos": 0,
      "node": "emqx@10.12.50.36",
      "clientid": "client_1",
      "nl": 0,
      "rap": 0,
      "rh": 0,
    },
    {
      "topic": "t/b",
      "qos": 1,
      "node": "emqx@10.12.50.36",
      "clientid": "client_1",
      "nl": 0,
      "rap": 0,
      "rh": 0,
    }
  ]
}