The "listTopics" action lists the names of MQTT topics that the server is tracking.
- You can return a filtered list by specifying a partial name in the
"partialName"property. - You can include additional items in the list by searching for words contained in the item’s metadata.
- Use
"describeTopics"to get detailed information about specific MQTT topics.
Request examples
Minimal
{
"action": "listTopics",
"authToken": "replaceWithAuthTokenFromCreateSession"
}Maximal
{
"api": "mq",
"apiVersion": "1.0",
"requestId": "2",
"action": "listTopics",
"params": {
"partialName": "test",
"search": null,
"dataFormat": "arrays",
"skipRecords": null,
"maxRecords": 20,
"label": {
"group": "group name",
"name": "label name"
}
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Response examples
Minimal
{
"result": {
"data": [
"test/ReasonCodes",
"test/SharedSubscriptions",
"test/topic1",
"test/topic2"
]
},
"errorCode": 0,
"errorMessage": "",
"authToken": "replaceWithAuthTokenFromCreateSession"
}Maximal
{
"result": {
"data": [
"test/ReasonCodes",
"test/SharedSubscriptions",
"test/topic1",
"test/topic2"
]
},
"requestId": "2",
"errorCode": 0,
"errorMessage": "",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Properties
Request properties ("params")
| Property | Description | Default | Topic | Limits (inclusive) |
|---|---|---|---|---|
dataFormat |
The There are three different (but similar) versions of the "dataFormat" property:
Two of those versions occur in a request, and another occurs in a response. They all indicate how data is formatted.
|
Optional with default of "arrays"
|
string |
|
label |
The A label is a tag that you can add to some objects, such as an MQTT topic or session. You can use list actions such as The |
Optional with default of null
|
object | "label": {
"group": "group name",
"name": "label name"
} |
|
label .group |
The The The group name may contain up to 64 bytes of UTF-8 encoded characters. When you assign a group name to a label, the server automatically checks if the group name exists in the list of groups that the
|
Optional with default of ""
|
string | 1 to 64 bytes |
|
label .name |
The The The |
Required - No default value | string | 1 to 64 bytes |
maxRecords |
The "maxRecords" property specifies the maximum number of records to be returned. It is used with "skipRecords" to paginate the results. If the value is not null or omitted, the server returns the maximum number of results specified by "maxRecords". |
Optional with default of 20 |
integer |
-1 to 65535
|
partialName |
The |
Optional with default of ""
|
string | 1 to 64 bytes |
search |
The
|
Optional with default of ""
|
string | 0 to 64 bytes |
skipRecords |
The "skipRecords" property specifies the number of records to skip over when paginating the results. It is used with "maxRecords" to paginate the results. If the value is not null or omitted, the server returns results from the beginning. If it is > 0, the server skips over the specified number of records and returns results starting from that point up until it returns the maximum number of results as defined by "maxRecords". |
Optional with default of 0
|
integer |
0 to 9223372036854775807
|
Response properties ("result")
| Property | Description | Type | Limits (inclusive) |
|---|---|---|---|
data |
The |
array of objects | The action determines its contents. |