Abrufen von PNS-Feedback (Platform Notification Services)
Ruft eine Azure Storage-Container-URL ab. Der Container enthält Feedbackdaten für den Notification Hub. Der Aufrufer kann dann die Azure Storage Services-REST-API verwenden, um den Inhalt des Containers abzurufen.
Anforderung
Methode | Anforderungs-URI | HTTP-Version |
---|---|---|
GET | https://{namespace}.servicebus.windows.net/{Notification Hub}/feedbackcontainer?api-version=2015-01 |
HTTP/1.1 |
Anforderungsheader
In der folgenden Tabelle werden erforderliche und optionale Anforderungsheader beschrieben.
Anforderungsheader | BESCHREIBUNG |
---|---|
Content-Type | application/xml;type=entry;charset=utf-8 |
Authorization | SAS-Token generiert, wie in Shared Access Signature Authentication with Service Bus angegeben. |
x-ms-version | 2015-01 |
Anforderungstext
Keine
Antwort
Die Antwort enthält den HTTP-Statuscode und einen Satz von Antwortheadern.
Antwortcodes
Code | BESCHREIBUNG |
---|---|
200 | Die Container-URL wurde abgerufen. |
401 | Autorisierungsfehler Der Zugriffsschlüssel war falsch. |
403 | Die Anforderung wurde abgelehnt, da das Feature für Ihre SKU nicht aktiviert ist. Upgrade auf Standard. |
Informationen zu status Codes finden Sie unter Status- und Fehlercodes.
Antwortheader
Keine
Antworttext
Bei Erfolg wird eine Azure Storage-Container-URL mit Authentifizierungstoken zurückgegeben.
Beispiel:
https://pushpnsfb5702abf7f71e31.blob.core.windows.net/00000000000297200840?sv=2014-02-14&sr=c&sig=XXxxxxxxxxxxxxx%xxxx%2xxxxxxxxxxxxxxxxxxxxxxxxxx%3D&se=2015-05-01T00%3A00%3A22Z&sp=rl
Die zurückgegebene URL kann dann verwendet werden, um im Container zu navigieren und den Inhalt mithilfe der Azure Storage Services-REST-API abzurufen.
Das folgende Beispiel zeigt PNS-Feedback, das angibt, dass WNS abgelaufene Kanäle mit zwei verschiedenen Benachrichtigungs-IDs verknüpft sind:
<EnumerationResults ServiceEndpoint="---Removed---" ContainerName="00000000002001061088">
<Blobs>
<Blob>
<Name>07272016</Name>
<Properties>
<Last-Modified>Wed, 27 Jul 2016 20:57:07 GMT</Last-Modified>
<Etag>---Removed---</Etag>
<Content-Length>7150</Content-Length>
<Content-Type>application/octet-stream</Content-Type>
<Content-Encoding />
<Content-Language />
<Content-MD5 />
<Cache-Control />
<Content-Disposition />
<BlobType>BlockBlob</BlobType>
<LeaseStatus>unlocked</LeaseStatus>
<LeaseState>available</LeaseState>
</Properties>
</Blob>
</Blobs>
<NextMarker />
</EnumerationResults>
Get Blob named : 07272016
<?xml version="1.0" encoding="utf-16"?>
<PnsFeedback xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect">
<FeedbackTime>2016-07-27T20:47:10.8905532Z</FeedbackTime>
<NotificationSystemError>ExpiredChannel</NotificationSystemError>
<Platform>windows</Platform>
<PnsHandle>---Removed---</PnsHandle>
<NotificationId>215e3aba529b49da9b6d35c134147952-20160727204710-2001061088-1</NotificationId>
</PnsFeedback>
<?xml version="1.0" encoding="utf-16"?>
<PnsFeedback xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect">
<FeedbackTime>2016-07-27T20:56:34.1588971Z</FeedbackTime>
<NotificationSystemError>ExpiredChannel</NotificationSystemError>
<Platform>windows</Platform>
<PnsHandle>---Removed---</PnsHandle>
<NotificationId>82d1e0626bd14221be7298341ae9a7b3-20160727205634-2001061088-1</NotificationId>
</PnsFeedback>
Beispielcode
Beispielcode, der diese REST-API veranschaulicht, ist im GitHub-Repository azure-notificationhubs-samples verfügbar.