Share via


プラットフォーム通知サービス (PNS) のフィードバックを取得する

Azure Storage コンテナーの URL を取得します。 コンテナーには、通知ハブのフィードバック データがあります。 呼び出し元は 、Azure Storage Services REST API を使用してコンテナーの内容を取得できます。

Request

Method 要求 URI HTTP バージョン
GET https://{namespace}.servicebus.windows.net/{Notification Hub}/feedbackcontainer?api-version=2015-01 HTTP/1.1

要求ヘッダー

必須要求ヘッダーと省略可能な要求ヘッダーを次の表に示します。

要求ヘッダー 説明
Content-Type application/xml;type=entry;charset=utf-8
承認 Service Bus を使用した Shared Access Signature Authentication で指定されたとおりに生成された SAS トークン。
x-ms-version 2015-01

要求本文

[なし] :

Response

応答には、HTTP 状態コードおよび一連の応答ヘッダーが含まれています。

応答コード

コード 説明
200 コンテナー URL をフェッチしました。
401 認証エラー。 アクセス キーが正しくありませんでした。
403 SKU に対して機能が有効になっていないため、要求は拒否されました。 Standard にアップグレードします。

状態コードの詳細については、「 状態コードとエラー コード」を参照してください。

応答ヘッダー

[なし] :

応答本文

成功すると、Azure Storage コンテナーの URL が返され、認証トークンで完了します。

次に例を示します。

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

返された URL を使用して、コンテナー内を移動し、Azure Storage Services REST API を使用して内容をフェッチできます

次に、2 つの異なる通知メッセージ ID に関連付けられている WNS の有効期限が切れたチャネルを示す PNS フィードバックの例を示します。

<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>

コード例

この REST API を示すコード例は、 azure-notificationhubs-samples GitHub リポジトリで入手できます。