次の方法で共有


Subscriptions - Update

既存のサブスクリプションを更新します。 サブスクリプションとアクセス許可の種類に応じて、呼び出し元は説明、フィルター設定、チャネル (配信) 設定などを更新できます。

PATCH https://{service}dev.azure.com/{organization}/_apis/notification/subscriptions/{subscriptionId}?api-version=7.1

URI パラメーター

名前 / 必須 説明
subscriptionId
path True

string

organization
path

string

Azure DevOps 組織の名前。

service
path

string

この要求の転送先となるサービス。

api-version
query True

string

使用する API のバージョン。 このバージョンの API を使用するには、これを '7.1' に設定する必要があります。

要求本文

名前 説明
adminSettings

SubscriptionAdminSettings

サブスクリプションの管理者が管理する設定。 サブスクライバーがグループであるサブスクリプションにのみ適用されます。

channel

ISubscriptionChannel

サブスクリプションによってトリガーされる通知を配信するためのチャネル。

description

string

サブスクリプションの説明を更新しました。 通常、サブスクリプションを識別するのに役立つフィルター条件について説明します。

filter

ISubscriptionFilter

サブスクリプションの一致条件。 ExpressionFilter

scope

SubscriptionScope

新しいサブスクリプションと一致させるためにイベントを発行する必要があるコンテナー。 指定しない場合、既定では現在のホスト (通常は現在のアカウントまたはプロジェクト コレクション) が使用されます。 たとえば、プロジェクト A をスコープとしたサブスクリプションでは、プロジェクト B から発行されたイベントの通知は生成されません。

status

SubscriptionStatus

サブスクリプションの状態を更新しました。 通常、サブスクリプションを有効または無効にするために使用されます。

statusMessage

string

更新された状態の詳細を示す省略可能なメッセージ。

userSettings

SubscriptionUserSettings

サブスクリプションのユーザーが管理する設定。 サブスクライバーがグループであるサブスクリプションにのみ適用されます。 通常、グループ サブスクリプションからユーザーをオプトインまたはオプトアウトするために使用されます。

応答

名前 説明
200 OK

NotificationSubscription

成功した操作

セキュリティ

oauth2

型: oauth2
フロー: accessCode
Authorization URL (承認 URL): https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL (トークン URL): https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

スコープ

名前 説明
vso.notification_write サブスクリプションへの読み取り/書き込みアクセスと、フィルター可能なフィールド値を含むイベント メタデータへの読み取りアクセスを提供します。

Change description
Disable a subscription

Change description

要求のサンプル

PATCH https://dev.azure.com/fabrikam/_apis/notification/subscriptions/114711?api-version=7.1

{
  "description": "All changes to work items in this account",
  "scope": {
    "id": null
  }
}

応答のサンプル

{
  "id": "114711",
  "url": "https://dev.azure.com/fabrikam/_apis/notification/Subscriptions/114711",
  "description": "All changes to work items in this account",
  "subscriber": {
    "id": "cd49a245-51cc-493a-ab1a-5c0feb5afaa3",
    "displayName": "Jamal Hartnett",
    "uniqueName": "fabrikamfiber16@outlook.com"
  },
  "status": "enabled",
  "flags": "none",
  "modifiedDate": "2017-03-13T04:46:15.21Z",
  "lastModifiedBy": {
    "id": "cd49a245-51cc-493a-ab1a-5c0feb5afaa3",
    "displayName": "Jamal Hartnett",
    "uniqueName": "fabrikamfiber16@outlook.com"
  },
  "scope": {
    "type": "none",
    "id": "00000000-0000-636f-6c6c-656374696f6e"
  },
  "filter": {
    "type": "Expression",
    "criteria": {
      "clauses": [
        {
          "logicalOperator": "",
          "fieldName": "",
          "operator": "=",
          "value": "",
          "index": 1
        }
      ],
      "groups": [],
      "maxGroupLevel": 0
    },
    "eventType": "ms.vss-work.workitem-changed-event"
  },
  "channel": {
    "type": "EmailHtml",
    "useCustomAddress": false
  },
  "_links": {
    "edit": {
      "href": "https://dev.azure.com/fabrikam/_notifications?subscriptionId=114711&publisherId=ms.vss-work.work-event-publisher&action=view"
    }
  },
  "permissions": "view, edit, delete"
}

Disable a subscription

要求のサンプル

PATCH https://dev.azure.com/fabrikam/_apis/notification/subscriptions/114711?api-version=7.1

{
  "status": "disabled"
}

応答のサンプル

{
  "id": "114711",
  "url": "https://dev.azure.com/fabrikam/_apis/notification/Subscriptions/114711",
  "description": "All changes to work items in this account",
  "subscriber": {
    "id": "cd49a245-51cc-493a-ab1a-5c0feb5afaa3",
    "displayName": "Jamal Hartnett",
    "uniqueName": "fabrikamfiber16@outlook.com"
  },
  "status": "disabled",
  "flags": "none",
  "modifiedDate": "2017-03-13T04:46:15.743Z",
  "lastModifiedBy": {
    "id": "cd49a245-51cc-493a-ab1a-5c0feb5afaa3",
    "displayName": "Jamal Hartnett",
    "uniqueName": "fabrikamfiber16@outlook.com"
  },
  "scope": {
    "type": "none",
    "id": "00000000-0000-636f-6c6c-656374696f6e"
  },
  "filter": {
    "type": "Expression",
    "criteria": {
      "clauses": [
        {
          "logicalOperator": "",
          "fieldName": "",
          "operator": "=",
          "value": "",
          "index": 1
        }
      ],
      "groups": [],
      "maxGroupLevel": 0
    },
    "eventType": "ms.vss-work.workitem-changed-event"
  },
  "channel": {
    "type": "EmailHtml",
    "useCustomAddress": false
  },
  "_links": {
    "edit": {
      "href": "https://dev.azure.com/fabrikam/_notifications?subscriptionId=114711&publisherId=ms.vss-work.work-event-publisher&action=view"
    }
  },
  "permissions": "view, edit, delete"
}

定義

名前 説明
IdentityRef
ISubscriptionChannel
ISubscriptionFilter
NotificationSubscription

サブスクリプションでは、一致するイベントの条件と、それらのイベントについてサブスクリプションのサブスクライバーに通知する方法を定義します。

NotificationSubscriptionUpdateParameters

既存のサブスクリプションを更新するためのパラメーター。 サブスクリプションでは、一致するイベントの条件と、それらのイベントについてサブスクリプションのサブスクライバーに通知する方法を定義します。 注: 更新するフィールドのみを設定する必要があります。

ReferenceLinks

REST 参照リンクのコレクションを表すクラス。

SubscriptionAdminSettings

グループ サブスクリプションの管理者が管理する設定。

SubscriptionDiagnostics

サブスクリプションのすべての診断設定が含まれています。

SubscriptionFlags

サブスクリプションをさらに説明する読み取り専用インジケーター。

SubscriptionPermissions

ユーザーがこのサブスクリプションに対して持っているアクセス許可。

SubscriptionScope

イベントの発行元となるリソース (通常はアカウントまたはプロジェクト)。

SubscriptionStatus

サブスクリプションの状態。 通常、サブスクリプションが有効かどうかを示します。

SubscriptionTracing

サブスクリプションの単一の診断設定を制御するデータ。

SubscriptionUserSettings

グループ サブスクリプションのユーザー管理設定。

IdentityRef

名前 説明
_links

ReferenceLinks

このフィールドには、グラフの件名に関する興味深いリンクが 0 個以上含まれています。 これらのリンクを呼び出して、このグラフの件名に関する追加のリレーションシップや詳細情報を取得できます。

descriptor

string

記述子は、システムの実行中にグラフの件名を参照する主な方法です。 このフィールドは、アカウントと組織の両方で同じグラフの件名を一意に識別します。

directoryAlias

string

非推奨 - IdentityRef "_links" ディクショナリの "自己" エントリで参照されている Graph ユーザーにクエリを実行することで取得できます

displayName

string

これは、グラフの件名の一意でない表示名です。 このフィールドを変更するには、ソース プロバイダーでその値を変更する必要があります。

id

string

imageUrl

string

非推奨 - IdentityRef "_links" ディクショナリの "アバター" エントリで使用できます

inactive

boolean

非推奨 - GraphUser "_links" ディクショナリの "membershipState" エントリで参照されている Graph メンバーシップの状態を照会することで取得できます

isAadIdentity

boolean

非推奨 - 記述子のサブジェクト型 (Descriptor.IsAadUserType/Descriptor.IsAadGroupType) から推論できます

isContainer

boolean

非推奨 - 記述子のサブジェクト型 (Descriptor.IsGroupType) から推論できます

isDeletedInOrigin

boolean

profileUrl

string

非推奨 - ToIdentityRef の既存のほとんどの実装では使用されていません

uniqueName

string

非推奨 - 代わりに Domain+PrincipalName を使用する

url

string

この URL は、このグラフの件名のソース リソースへの完全なルートです。

ISubscriptionChannel

名前 説明
type

string

ISubscriptionFilter

名前 説明
eventType

string

type

string

NotificationSubscription

サブスクリプションでは、一致するイベントの条件と、それらのイベントについてサブスクリプションのサブスクライバーに通知する方法を定義します。

名前 説明
_links

ReferenceLinks

サブスクリプションの関連リソース、API、ビューへのリンク。

adminSettings

SubscriptionAdminSettings

サブスクリプションの管理者が管理する設定。 サブスクライバーがグループである場合にのみ適用されます。

channel

ISubscriptionChannel

サブスクリプションによってトリガーされる通知を配信するためのチャネル。

description

string

サブスクリプションの説明。 通常、サブスクリプションを識別するのに役立つフィルター条件について説明します。

diagnostics

SubscriptionDiagnostics

このサブスクリプションの診断。

extendedProperties

object

さまざまなコンテキスト、ユーザー/グループ コンテキストの詳細な説明などの追加のプロパティ

filter

ISubscriptionFilter

サブスクリプションの一致条件。 ExpressionFilter

flags

SubscriptionFlags

サブスクリプションをさらに説明する読み取り専用インジケーター。

id

string

サブスクリプション識別子。

lastModifiedBy

IdentityRef

サブスクリプションを最後に変更 (または作成) したユーザー。

modifiedDate

string (date-time)

サブスクリプションが最後に変更された日付。 サブスクリプションが作成されてから更新されていない場合、この値はサブスクリプションが作成された日時を示します。

permissions

SubscriptionPermissions

ユーザーがこのサブスクリプションに対して持っているアクセス許可。

scope

SubscriptionScope

サブスクリプションと一致させるためにイベントを発行する必要があるコンテナー。 空の場合、スコープは現在のホスト (通常はアカウントまたはプロジェクト コレクション) です。 たとえば、プロジェクト A をスコープとしたサブスクリプションでは、プロジェクト B から発行されたイベントの通知は生成されません。

status

SubscriptionStatus

サブスクリプションの状態。 通常、サブスクリプションが有効かどうかを示します。

statusMessage

string

サブスクリプションの状態の詳細を示すメッセージ。

subscriber

IdentityRef

サブスクリプションのフィルター条件に一致するイベントの通知を受信するユーザーまたはグループ。

url

string

サブスクリプションの REST API URL。

userSettings

SubscriptionUserSettings

サブスクリプションのユーザーが管理する設定。 サブスクライバーがグループである場合にのみ適用されます。 通常、呼び出し元のユーザーがグループ サブスクリプションにオプトインされているか、またはグループ サブスクリプションからオプトアウトされているかを示すために使用されます。

NotificationSubscriptionUpdateParameters

既存のサブスクリプションを更新するためのパラメーター。 サブスクリプションでは、一致するイベントの条件と、それらのイベントについてサブスクリプションのサブスクライバーに通知する方法を定義します。 注: 更新するフィールドのみを設定する必要があります。

名前 説明
adminSettings

SubscriptionAdminSettings

サブスクリプションの管理者が管理する設定。 サブスクライバーがグループであるサブスクリプションにのみ適用されます。

channel

ISubscriptionChannel

サブスクリプションによってトリガーされる通知を配信するためのチャネル。

description

string

サブスクリプションの説明を更新しました。 通常、サブスクリプションを識別するのに役立つフィルター条件について説明します。

filter

ISubscriptionFilter

サブスクリプションの一致条件。 ExpressionFilter

scope

SubscriptionScope

新しいサブスクリプションと一致させるためにイベントを発行する必要があるコンテナー。 指定しない場合、既定では現在のホスト (通常は現在のアカウントまたはプロジェクト コレクション) が使用されます。 たとえば、プロジェクト A をスコープとしたサブスクリプションでは、プロジェクト B から発行されたイベントの通知は生成されません。

status

SubscriptionStatus

サブスクリプションの状態を更新しました。 通常、サブスクリプションを有効または無効にするために使用されます。

statusMessage

string

更新された状態の詳細を示す省略可能なメッセージ。

userSettings

SubscriptionUserSettings

サブスクリプションのユーザーが管理する設定。 サブスクライバーがグループであるサブスクリプションにのみ適用されます。 通常、グループ サブスクリプションからユーザーをオプトインまたはオプトアウトするために使用されます。

REST 参照リンクのコレクションを表すクラス。

名前 説明
links

object

リンクの読み取りビュー。 参照リンクは読み取り専用であるため、読み取り専用として公開する必要があります。

SubscriptionAdminSettings

グループ サブスクリプションの管理者が管理する設定。

名前 説明
blockUserOptOut

boolean

true の場合、関連付けられているサブスクリプションにサブスクライブしているグループのメンバーはオプトできません (通知を受け取らない選択)

SubscriptionDiagnostics

サブスクリプションのすべての診断設定が含まれています。

名前 説明
deliveryResults

SubscriptionTracing

配信結果を保持するための診断設定。 Service Hooks サブスクリプションに使用されます。

deliveryTracing

SubscriptionTracing

通知配信をトラブルシューティングするための診断設定。

evaluationTracing

SubscriptionTracing

イベント照合のトラブルシューティングのための診断設定。

SubscriptionFlags

サブスクリプションをさらに説明する読み取り専用インジケーター。

説明
canOptOut

サブスクリプションのサブスクライバー グループのメンバーであるユーザーは、サブスクリプションをオプトインまたはオプトアウトできます。

contributedSubscription

サブスクリプションは提供され、永続化されません。 つまり、フィルターなど、サブスクリプションの特定のフィールドは読み取り専用です。

groupSubscription

サブスクリプションのサブスクライバーはグループであり、ユーザーではありません

none

何一つ

oneActorMatches

ロール ベースのサブスクリプションの場合、一致するアクターが常に少なくとも 1 つ存在することが期待されます。

teamSubscription

サブスクライバーがグループの場合は、チームになります。

SubscriptionPermissions

ユーザーがこのサブスクリプションに対して持っているアクセス許可。

説明
delete

サブスクリプションの削除

edit

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

none

何一つ

view

説明、フィルターなどの完全なビュー。制限はありません。

SubscriptionScope

イベントの発行元となるリソース (通常はアカウントまたはプロジェクト)。

名前 説明
id

string (uuid)

必須: これは、型のスコープの ID です。

name

string

省略可能: スコープの表示名

type

string

必須: スコープのイベント固有の型。

SubscriptionStatus

サブスクリプションの状態。 通常、サブスクリプションが有効かどうかを示します。

説明
disabled

サブスクリプションは、通常はサブスクリプションの所有者によって無効になり、通知は生成されません。

disabledArgumentException

サブスクリプションの処理中に引数例外が発生したため、サブスクリプションが無効になっている

disabledAsDuplicateOfDefault

サブスクリプションは既定のサブスクリプションの複製であるため無効になっています。

disabledByAdmin

サブスクリプションは、サブスクリプションのサブスクライバーではなく、管理者によって無効になります。

disabledFromProbation

障害が発生したため、サブスクリプションはサービスを無効にしています。

disabledInactiveIdentity

ID がアクティブではなくなったため、サブスクリプションが無効になっている

disabledInvalidPathClause

無効なフィルター式があるため、サブスクリプションは無効です。

disabledInvalidRoleExpression

サブスクリプションは無効なロール式を持っているため無効です。

disabledMessageQueueNotSupported

メッセージ キューがサポートされていないため、サブスクリプションは無効になっています。

disabledMissingIdentity

サブスクライバーが不明であるため、サブスクリプションは無効になっています。

disabledMissingPermissions

ID に適切なアクセス許可がないため、サブスクリプションが無効になっています

disabledProjectInvalid

プロジェクトが無効であるため、サブスクリプションが無効です

enabled

サブスクリプションがアクティブです。

enabledOnProbation

サブスクリプションはアクティブですが、配信の失敗やサブスクリプションに関するその他の問題が原因で保護観察中です。

jailedByNotificationsVolume

大量の通知が生成されたため、サブスクリプションは無効になります。

pendingDeletion

サブスクリプションは無効になっており、削除されます。

SubscriptionTracing

サブスクリプションの単一の診断設定を制御するデータ。

名前 説明
enabled

boolean

診断トレースが有効かどうかを示します。

endDate

string (date-time)

指定した終了日までトレースします。

maxTracedEntries

integer (int32)

トレースする結果の詳細の最大数。

startDate

string (date-time)

トレースが開始された日付と時刻。

tracedEntries

integer (int32)

残りの数が 0 に達するまでトレースします。

SubscriptionUserSettings

グループ サブスクリプションのユーザー管理設定。

名前 説明
optedOut

boolean

関連付けられているグループ サブスクリプションの通知をユーザーが受信するかどうかを示します。