ListSubscriptions
Returns a list of all subscriptions for MQTT clients with active sessions, including offline clients with persistent sessions.
Requires permission to access the ListSubscriptions action.
Request Syntax
GET /connections/clientId/subscriptions?maxResults=maxResults&nextToken=nextToken HTTP/1.1
URI Request Parameters
The request uses the following URI parameters.
- clientId
-
The unique identifier of the MQTT client to list subscriptions for. The client ID can't start with a dollar sign ($).
MQTT client IDs must be URL encoded (percent-encoded) when they contain characters that are not valid in HTTP requests, such as spaces, forward slashes (/), and UTF-8 characters.
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern:
^[^$].*Required: Yes
- maxResults
-
The maximum number of subscriptions to return in a single request. By default, this is set to 20.
Valid Range: Minimum value of 1. Maximum value of 200.
- nextToken
-
To retrieve the next set of results, the
nextTokenvalue from a previous response; otherwise null to receive the first set of results.
Request Body
The request does not have a request body.
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"nextToken": "string",
"subscriptions": [
{
"qos": number,
"topicFilter": "string"
}
]
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- nextToken
-
The token to use to get the next set of results, or null if there are no additional results.
Type: String
- subscriptions
-
A list of topic filters and their associated Quality of Service (QoS) levels that the client is subscribed to.
Type: Array of SubscriptionSummary objects
Errors
- ForbiddenException
-
The caller isn't authorized to make the request.
HTTP Status Code: 403
- InternalFailureException
-
An unexpected error has occurred.
- message
-
The message for the exception.
HTTP Status Code: 500
- InvalidRequestException
-
The request is not valid.
- message
-
The message for the exception.
HTTP Status Code: 400
- ResourceNotFoundException
-
The specified resource does not exist.
- message
-
The message for the exception.
HTTP Status Code: 404
- ThrottlingException
-
The rate exceeds the limit.
- message
-
The message for the exception.
HTTP Status Code: 429
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: