次の方法で共有


Subscriptions - Create

サブスクリプションを作成します。

POST https://dev.azure.com/{organization}/_apis/hooks/subscriptions?api-version=7.1

URI パラメーター

名前 / 必須 説明
organization
path True

string

Azure DevOps 組織の名前。

api-version
query True

string

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

要求本文

名前 説明
_links

ReferenceLinks

参照リンク

actionDescription

string

consumerActionId

string

consumerId

string

consumerInputs

object

コンシューマーの入力値

createdBy

IdentityRef

createdDate

string (date-time)

eventDescription

string

eventType

string

id

string (uuid)

lastProbationRetryDate

string (date-time)

modifiedBy

IdentityRef

modifiedDate

string (date-time)

probationRetries

string (byte)

publisherId

string

publisherInputs

object

発行元の入力値

resourceVersion

string

status

SubscriptionStatus

subscriber

IdentityRef

url

string

応答

名前 説明
200 OK

Subscription

成功した操作

セキュリティ

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.work 作業項目、クエリ、ボード、領域とイテレーションのパス、およびその他の作業項目追跡関連のメタデータを読み取る機能を付与します。 また、クエリを実行したり、作業項目を検索したり、サービス フックを介して作業項目イベントに関する通知を受信したりすることもできます。
vso.build ビルドの結果、定義、要求など、ビルド成果物にアクセスする機能と、サービス フックを介してビルド イベントに関する通知を受信する機能を付与します。
vso.code コミット、変更セット、ブランチ、およびその他のバージョン管理成果物に関するソース コードとメタデータを読み取る機能を付与します。 また、コードを検索し、サービス フックを使用してバージョン管理イベントに関する通知を受け取る機能も付与されます。

要求のサンプル

POST https://dev.azure.com/fabrikam/_apis/hooks/subscriptions?api-version=7.1

{
  "publisherId": "tfs",
  "eventType": "build.complete",
  "resourceVersion": "1.0-preview.1",
  "consumerId": "webHooks",
  "consumerActionId": "httpRequest",
  "publisherInputs": {
    "buildStatus": "Failed",
    "definitionName": "MyWebSite CI",
    "projectId": "6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c"
  },
  "consumerInputs": {
    "url": "https://myservice/newreceiver"
  }
}

応答のサンプル

{
  "id": "fd672255-8b6b-4769-9260-beea83d752ce",
  "url": "https://dev.azure.com/fabrikam/_apis/hooks/subscriptions/fd672255-8b6b-4769-9260-beea83d752ce",
  "publisherId": "tfs",
  "eventType": "build.complete",
  "resourceVersion": "1.0-preview.1",
  "eventDescription": "Build MyWebSite CI, status Failed",
  "consumerId": "webHooks",
  "consumerActionId": "httpRequest",
  "actionDescription": "To host myservice",
  "createdBy": {
    "id": "00ca946b-2fe9-4f2a-ae2f-40d5c48001bc"
  },
  "createdDate": "2014-10-27T15:37:24.873Z",
  "modifiedBy": {
    "id": "00ca946b-2fe9-4f2a-ae2f-40d5c48001bc"
  },
  "modifiedDate": "2014-10-27T15:37:26.23Z",
  "publisherInputs": {
    "buildStatus": "Failed",
    "definitionName": "MyWebSite CI",
    "hostId": "d81542e4-cdfa-4333-b082-1ae2d6c3ad16",
    "projectId": "6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c",
    "tfsSubscriptionId": "3e8b33e7-426d-4c92-9bf9-58e163dd7dd5"
  },
  "consumerInputs": {
    "url": "https://myservice/newreceiver"
  }
}

定義

名前 説明
IdentityRef
ReferenceLinks

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

Subscription

イベント サブスクリプションをカプセル化します。

SubscriptionStatus

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 は、このグラフの件名のソース リソースへの完全なルートです。

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

名前 説明
links

object

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

Subscription

イベント サブスクリプションをカプセル化します。

名前 説明
_links

ReferenceLinks

参照リンク

actionDescription

string

consumerActionId

string

consumerId

string

consumerInputs

object

コンシューマーの入力値

createdBy

IdentityRef

createdDate

string (date-time)

eventDescription

string

eventType

string

id

string (uuid)

lastProbationRetryDate

string (date-time)

modifiedBy

IdentityRef

modifiedDate

string (date-time)

probationRetries

string (byte)

publisherId

string

publisherInputs

object

発行元の入力値

resourceVersion

string

status

SubscriptionStatus

subscriber

IdentityRef

url

string

SubscriptionStatus

説明
disabledByInactiveIdentity

所有者が非アクティブであるか、アクセス許可がないため、サブスクリプションは無効になります。

disabledBySystem

サブスクリプションはシステムによって無効になっています。

disabledByUser

サブスクリプションはユーザーによって無効になっています。

enabled

サブスクリプションが有効になっています。

onProbation

サブスクリプションは、システムによって一時的に保護観察中です。