你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
读取通道的所有注册
检索通道的所有注册(例如,ChannelUri、设备令牌、GCM registrationId)。
请求
方法 | 请求 URI | HTTP 版本 |
---|---|---|
GET | https://{namespace}.servicebus.windows.net/{NotificationHub}/registrations/?$filter=ChannelUri eq '{channelUri}'&api-version=2015-01 或 https://{namespace}.servicebus.windows.net/{NotificationHub}/registrations/?$filter=DeviceToken eq '{deviceToken}'&api-version=2015-01 或 https://{namespace}.servicebus.windows.net/{NotificationHub}/registrations/?$filter=GcmRegistrationId eq '{gcmRegistrationId}'&api-version=2015-01 |
请注意以下几点:
- 此调用支持 OData 中指定的 $top 查询字符串参数。
- 此调用支持 ContinuationToken 查询字符串参数,以继续进行枚举。
- ChannelUri 经过 URL 编码。
- DeviceToken 必须是大写十六进制格式。
请求标头
下表介绍必需的和可选的请求标头。
请求标头 | 说明 |
---|---|
授权 | 按 服务总线的共享访问签名身份验证中指定的方式生成的 SAS 令牌。 |
x-ms-version | 2015-01 |
请求正文
无。
响应
响应包括 HTTP 状态代码和一组响应标头。
响应代码
代码 | 说明 |
---|---|
200 | 注册检索成功。 |
400 | 错误的请求。 通知中心不支持此查询 |
401 | 授权失败。 访问密钥不正确。 |
403 | 已超出配额;因注册操作率过高,请求被拒绝。 |
有关状态代码的信息,请参阅 状态和错误代码。
响应头
响应标头 | 说明 |
---|---|
Content-type | application/atom+xml;type=entry;charset=utf-8 |
X-MS-ContinuationToken | 当有更多注册时,包含用于继续枚举注册的令牌。 |
响应正文
以 创建注册中指定的 xml 格式包装注册列表的 Atom 源。 例如:
<?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="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:etag="W/"1234567890"">
<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="http://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>