サブスクリプションの更新

SharePoint リスト上で webhook サブスクリプションを更新します。

アクセス許可

アプリケーションには、少なくともサブスクリプションが更新される SharePoint リストへの編集許可が必要です。

アプリケーションが、Microsoft Azure Active Directory (Azure AD) アプリケーションである場合

You must grant the Azure AD application the permissions specified in the following table. A subscription can only be updated by the Azure AD application that created it.

アプリケーション アクセス許可
Office 365 SharePoint Online すべてのサイト コレクション内のアイテムおよびリストを読み取り、書き込みます。

アプリケーションが SharePoint アドインである場合

次のアクセス許可もしくはそれ以上の許可を SharePoint アドインに与える必要があります。 サブスクリプションは、それを作成した SharePoint アドインでのみ更新できます。

スコープ アクセス権限
リスト 管理

HTTP 要求

PATCH _api/web/lists('list-id')/subscriptions('id')

PATCH _api/web/lists('5C77031A-9621-4DFC-BB5D-57803A94E91D')/subscriptions('6D77031A-2345-5GRT-BV3D-55234B56FR43')
Content-Type: application/json

{
  "notificationUrl": "https://contoso.azurewebsites.net/api/v2/webhook-receiver",
  "expirationDateTime": "2016-01-03T11:23:00.000Z"
}

要求本文

要求の本文には次のプロパティが含まれます。

名前 説明
notificationUrl 文字列 通知の送信先のサービス URL。
expirationDateTime 日付 通知の有効期限が切れ、削除される日。
clientState string Optional. Opaque string passed back to the client on all notifications.
これは通知の検証や、他のサブスクリプションのタグ付けで使用できます。

応答

サブスクリプションが見つかり、正常に更新されると、204 No Content 応答が返されます。

HTTP/1.1 204 No Content

関連項目