Share via


Read All Registrations of a Channel

 

Retrieves all registrations for a channel (for example, ChannelUri, device token, GCM registrationId).

Request

Method

Request URI

HTTP version

GET

https://{namespace}.servicebus.windows.net/{NotificationHub}/registrations/?$filter=ChannelUri eq ‘{channelUri}’&api-version=2015-01

or

https://{namespace}.servicebus.windows.net/{NotificationHub}/registrations/?$filter=DeviceToken eq ‘{deviceToken}’&api-version=2015-01

or

https://{namespace}.servicebus.windows.net/{NotificationHub}/registrations/?$filter=GcmRegistrationId eq ‘{gcmRegistrationId}’&api-version=2015-01

HTTP/1.1

Note the following:

  • This call supports the $top query string parameter as specified in OData.

  • This call supports a ContinuationToken query string parameter to continue the enumeration.

  • ChannelUri is url-encoded.

  • DeviceToken must be in uppercase hex format.

Request Headers

The following table describes required and optional request headers.

Request Header

Description

Authorization

Token generated as specified in Shared Access Signature Authentication with Service Bus, or Service Bus authentication and authorization with Microsoft Azure Active Directory Access Control (also known as Access Control Service or ACS).

x-ms-version

2015-01

Request Body

None.

Response

The response includes an HTTP status code and a set of response headers.

Response Codes

Code

Description

200

Registrations retrieved successfully.

400

Bad Request. Notification hubs do not support this query

401

Authorization failure. The access key was incorrect.

403

Quota exceeded; request rejected because registration operations rate is too high.

For information about status codes, see Status and Error Codes.

Response Headers

Response Header

Description

Content-type

application/atom+xml;type=entry;charset=utf-8

X-MS-ContinuationToken

Contains the token to continue the enumeration of registrations, in case there are more.

Response Body

Atom feed that wraps the list of registrations in the xml format specified in Create Registration. For example:

<?xml version="1.0" encoding="utf-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="/{NotificationTopic}/channels/{channel hash}" />
  <id> https://{tenant}.windows.net/{NotificationTopic}/channels/{channel hash}</id>
  <updated>2012-08-17T17:32:00Z</updated>
  <entry xmlns:m=”https://schemas.microsoft.com/ado/2007/08/dataservices/metadata” m:etag=”W/&quot;1234567890&quot;”>
    <id>https://{tenant}.windows.net/{NotificationTopic}/registrations/{registrationId}</id>
    <title type="text"> /{NotificationTopic}/registrations/{registrationId}</title>
    <updated>2012-08-17T17:32:00Z</updated>
    <content type="application/xml">
    <WindowsRegistrationDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://schemas.microsoft.com/netservices/2010/10/servicebus/connect">
            <ETag>{ETag}</ETag>
        <ExpirationTime>2012-07-16T19:20+01:00</ExpirationTime>
        <RegistrationId>{RegistrationId}</RegistrationId>
            <Tags>myTag, myOtherTag</Tags>
            <ChannelUri>{ChannelUri}</ChannelUri>
        </WindowsRegistrationDescription>
    </content>
  </entry>
  <entry>
    …
  </entry>
</feed>