# Subscription

# Get All Subscription Information

Return all subscription information under the cluster, support paging.

# URI

GET /subscriptions

# Request Message

NameTypeDescription
clientidStringClient identifier
topicStringcongruent query
qosEnumPossible values are 0,1,2
shareStringShared subscription group name
_match_topicStringTopic Match query

# Response Message

名称类型描述
codeInteger0
dataArray of ObjectsAll subscription information
data[].nodeStringNode name
data[].clientidStringClient identification
data[].topicStringTopic
data[].qosIntegerQoS level
metaObjectPaging information
meta.pageIntegerPage number
meta.limitIntegerThe number of data displayed per page
meta.countIntegerTotal number of data

# Request Example

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

# Response Example

{
  "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
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

# Get All Subscription Information for the Specified Client

# URI

GET /subscriptions/{clientid}

# Request Message

NameTypeDescription
_pageIntegerPage number
_limitIntegerThe number of data display per page
clientidStringClient identifier
qosEnumPossible values are 0,1,2
shareStringShared subscription group name
_match_topicStringTopic Match query

# Response Message

名称类型描述
codeInteger0
dataArray of ObjectsAll subscription information
data[].nodeStringNode name
data[].clientidStringClient identification
data[].topicStringTopic

# Request Message

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

# Response Message

{
  "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
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17