共用方式為


Publishers - List

取得發行者清單。

GET https://dev.azure.com/{organization}/_apis/hooks/publishers?api-version=7.1-preview.1

URI 參數

名稱 位於 必要 類型 Description
organization
path True

string

Azure DevOps 組織的名稱。

api-version
query True

string

要使用的 API 版本。 這應該設定為 '7.1-preview.1' 以使用此版本的 API。

回應

名稱 類型 Description
200 OK

Publisher[]

成功作業

安全性

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token 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

Scopes

名稱 Description
vso.work 授與讀取工作專案、查詢、面板、區域和反復專案路徑,以及其他工作專案追蹤相關中繼資料的能力。 同時授與執行查詢、搜尋工作專案,以及透過服務勾點接收工作專案事件的通知的能力。
vso.build 授與存取組建成品的能力,包括建置結果、定義和要求,以及能夠透過服務勾點接收有關建置事件的通知。
vso.code 授與讀取有關認可、變更集、分支和其他版本控制成品之原始程式碼和中繼資料的能力。 也授與搜尋程式碼的能力,並透過服務勾點取得版本控制事件的通知。

範例

Sample Request

GET https://dev.azure.com/fabrikam/_apis/hooks/publishers?api-version=7.1-preview.1

Sample Response

{
  "count": 1,
  "value": [
    {
      "id": "tfs",
      "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs",
      "name": "Azure DevOps Server",
      "description": "Publishes Azure DevOps Server events",
      "supportedEvents": [
        {
          "publisherId": "tfs",
          "id": "build.complete",
          "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/build.complete",
          "name": "Build completed",
          "description": "A build completes",
          "supportedResourceVersions": [
            "1.0-preview.1"
          ],
          "inputDescriptors": [
            {
              "id": "definitionName",
              "name": "Build Definition",
              "description": "Filter events to include only completed builds for the specified definition",
              "inputMode": "combo",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "validation": {
                "dataType": "string"
              },
              "values": {
                "defaultValue": "",
                "possibleValues": [
                  {
                    "value": "",
                    "displayValue": "[Any]"
                  }
                ],
                "isLimitedToPossibleValues": true
              },
              "hasDynamicValueInformation": true
            },
            {
              "id": "buildStatus",
              "name": "Build Status",
              "description": "Filter events to include only completed builds for the specified completion status",
              "inputMode": "combo",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "values": {
                "defaultValue": "",
                "possibleValues": [
                  {
                    "value": "",
                    "displayValue": "[Any]"
                  },
                  {
                    "value": "Succeeded",
                    "displayValue": "Succeeded"
                  },
                  {
                    "value": "PartiallySucceeded",
                    "displayValue": "Partially Succeeded"
                  },
                  {
                    "value": "Failed",
                    "displayValue": "Failed"
                  },
                  {
                    "value": "Stopped",
                    "displayValue": "Stopped"
                  }
                ],
                "isLimitedToPossibleValues": true
              }
            }
          ]
        },
        {
          "publisherId": "tfs",
          "id": "message.posted",
          "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/message.posted",
          "name": "Team room message posted",
          "description": "Triggers when a message is posted to a team room",
          "supportedResourceVersions": [
            "1.0-preview.1"
          ],
          "inputDescriptors": [
            {
              "id": "roomId",
              "name": "Team room",
              "description": "Filter events to include only messages sent to the specified Team room",
              "inputMode": "combo",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "validation": {
                "dataType": "number",
                "isRequired": true
              },
              "values": {
                "defaultValue": "",
                "possibleValues": []
              },
              "hasDynamicValueInformation": true
            },
            {
              "id": "messagePattern",
              "name": "Message contains string",
              "description": "The string that must be found in the message",
              "inputMode": "textBox",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "validation": {
                "dataType": "string",
                "pattern": "^[^&<>'\"]*$",
                "patternMismatchErrorMessage": "Value cannot contain any of characters: &, <, >, ' (apostrophe), or \\\" (quote).",
                "maxLength": 1024
              },
              "values": {
                "defaultValue": "",
                "possibleValues": []
              }
            }
          ]
        },
        {
          "publisherId": "tfs",
          "id": "git.pullrequest.created",
          "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/git.pullrequest.created",
          "name": "Pull request created",
          "description": "Pull request is created in a git repository",
          "supportedResourceVersions": [
            "1.0-preview.1"
          ],
          "inputDescriptors": [
            {
              "id": "repository",
              "name": "Repository",
              "description": "The repository that code was pushed to",
              "inputMode": "combo",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "validation": {
                "dataType": "guid"
              },
              "values": {
                "possibleValues": [
                  {
                    "value": "",
                    "displayValue": "[Any]"
                  }
                ],
                "isLimitedToPossibleValues": true
              },
              "hasDynamicValueInformation": true
            },
            {
              "id": "branch",
              "name": "Target branch",
              "description": "The target branch of the pull request",
              "inputMode": "combo",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "values": {
                "possibleValues": [
                  {
                    "value": "",
                    "displayValue": "[Any]"
                  }
                ],
                "isLimitedToPossibleValues": true
              },
              "dependencyInputIds": [
                "repository"
              ],
              "hasDynamicValueInformation": true
            }
          ]
        },
        {
          "publisherId": "tfs",
          "id": "git.pullrequest.updated",
          "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/git.pullrequest.updated",
          "name": "Pull request updated",
          "description": "Pull request is updated – status, review list, reviewer vote changed or the source branch is updated with a push",
          "supportedResourceVersions": [
            "1.0-preview.1"
          ],
          "inputDescriptors": [
            {
              "id": "repository",
              "name": "Repository",
              "description": "The repository that code was pushed to",
              "inputMode": "combo",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "validation": {
                "dataType": "guid"
              },
              "values": {
                "possibleValues": [
                  {
                    "value": "",
                    "displayValue": "[Any]"
                  }
                ],
                "isLimitedToPossibleValues": true
              },
              "hasDynamicValueInformation": true
            },
            {
              "id": "branch",
              "name": "Target branch",
              "description": "The target branch of the pull request",
              "inputMode": "combo",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "values": {
                "possibleValues": [
                  {
                    "value": "",
                    "displayValue": "[Any]"
                  }
                ],
                "isLimitedToPossibleValues": true
              },
              "dependencyInputIds": [
                "repository"
              ],
              "hasDynamicValueInformation": true
            },
            {
              "id": "notificationType",
              "name": "Change",
              "description": "The type of pull request change",
              "inputMode": "combo",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "validation": {
                "dataType": "string"
              },
              "values": {
                "defaultValue": "",
                "possibleValues": [
                  {
                    "value": "",
                    "displayValue": "[Any]"
                  },
                  {
                    "value": "PushNotification",
                    "displayValue": "Source branch updated"
                  },
                  {
                    "value": "ReviewersUpdateNotification",
                    "displayValue": "Reviewers changed"
                  },
                  {
                    "value": "StatusUpdateNotification",
                    "displayValue": "Status changed"
                  },
                  {
                    "value": "ReviewerVoteNotification",
                    "displayValue": "Votes score changed"
                  }
                ],
                "isLimitedToPossibleValues": true,
                "isReadOnly": true
              }
            }
          ]
        },
        {
          "publisherId": "tfs",
          "id": "git.push",
          "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/git.push",
          "name": "Code pushed",
          "description": "Code is pushed to a git repository",
          "supportedResourceVersions": [
            "1.0-preview.1"
          ],
          "inputDescriptors": [
            {
              "id": "repository",
              "name": "Repository",
              "description": "The repository that code was pushed to",
              "inputMode": "combo",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "validation": {
                "dataType": "guid"
              },
              "values": {
                "possibleValues": [
                  {
                    "value": "",
                    "displayValue": "[Any]"
                  }
                ],
                "isLimitedToPossibleValues": true
              },
              "hasDynamicValueInformation": true
            },
            {
              "id": "branch",
              "name": "Branch",
              "description": "The branch that code was pushed into",
              "inputMode": "combo",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "values": {
                "possibleValues": [
                  {
                    "value": "",
                    "displayValue": "[Any]"
                  }
                ],
                "isLimitedToPossibleValues": true
              },
              "dependencyInputIds": [
                "repository"
              ],
              "hasDynamicValueInformation": true
            }
          ]
        },
        {
          "publisherId": "tfs",
          "id": "tfvc.checkin",
          "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/tfvc.checkin",
          "name": "Code checked in",
          "description": "A changeset is checked into version control.",
          "supportedResourceVersions": [
            "1.0-preview.1"
          ],
          "inputDescriptors": [
            {
              "id": "path",
              "name": "Under path",
              "description": "Filter to checkins that change one or more files under the specified path",
              "inputMode": "textBox",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "validation": {
                "dataType": "string",
                "isRequired": true,
                "pattern": "^\\$\\/[^&<>'\"]*$"
              },
              "values": {
                "defaultValue": "$/"
              }
            }
          ]
        },
        {
          "publisherId": "tfs",
          "id": "workitem.created",
          "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/workitem.created",
          "name": "Work item created",
          "description": "Filter events to include only newly created work items.",
          "supportedResourceVersions": [
            "1.0-preview.2",
            "1.0-preview.1"
          ],
          "inputDescriptors": [
            {
              "id": "areaPath",
              "name": "Area path",
              "description": "Filter events to include only work items under the specified area path.",
              "inputMode": "combo",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "validation": {
                "dataType": "string"
              },
              "values": {
                "defaultValue": "",
                "possibleValues": [
                  {
                    "value": "",
                    "displayValue": "[Any]"
                  }
                ],
                "isLimitedToPossibleValues": true,
                "isReadOnly": true
              },
              "hasDynamicValueInformation": true
            },
            {
              "id": "workItemType",
              "name": "Work item type",
              "description": "Filter events to include only work items of the specified type.",
              "inputMode": "combo",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "validation": {
                "dataType": "string"
              },
              "values": {
                "defaultValue": "",
                "possibleValues": [
                  {
                    "value": "",
                    "displayValue": "[Any]"
                  }
                ],
                "isLimitedToPossibleValues": true,
                "isReadOnly": true
              },
              "hasDynamicValueInformation": true
            }
          ]
        },
        {
          "publisherId": "tfs",
          "id": "workitem.commented",
          "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/workitem.commented",
          "name": "Work item commented on",
          "description": "Filter events to include only work items commented on.",
          "supportedResourceVersions": [
            "1.0-preview.2",
            "1.0-preview.1"
          ],
          "inputDescriptors": [
            {
              "id": "areaPath",
              "name": "Area path",
              "description": "Filter events to include only work items under the specified area path.",
              "inputMode": "combo",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "validation": {
                "dataType": "string"
              },
              "values": {
                "defaultValue": "",
                "possibleValues": [
                  {
                    "value": "",
                    "displayValue": "[Any]"
                  }
                ],
                "isLimitedToPossibleValues": true,
                "isReadOnly": true
              },
              "hasDynamicValueInformation": true
            },
            {
              "id": "workItemType",
              "name": "Work item type",
              "description": "Filter events to include only work items of the specified type.",
              "inputMode": "combo",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "validation": {
                "dataType": "string"
              },
              "values": {
                "defaultValue": "",
                "possibleValues": [
                  {
                    "value": "",
                    "displayValue": "[Any]"
                  }
                ],
                "isLimitedToPossibleValues": true,
                "isReadOnly": true
              },
              "hasDynamicValueInformation": true
            },
            {
              "id": "commentPattern",
              "name": "Contains string",
              "description": "The string that must be found in the comment.",
              "inputMode": "textBox",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "validation": {
                "dataType": "string",
                "pattern": "^\\s*[^\\s&<>'\"][^&<>'\"]*$",
                "patternMismatchErrorMessage": "Value should contain at least one non whitespace character and cannot contain any of characters: &, <, >, ' (apostrophe), or \" (quote).",
                "minLength": 1,
                "maxLength": 1024
              },
              "values": {
                "defaultValue": "",
                "possibleValues": []
              }
            }
          ]
        },
        {
          "publisherId": "tfs",
          "id": "workitem.updated",
          "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/workitem.updated",
          "name": "Work item updated",
          "description": "Filter events to include only changed work items.",
          "supportedResourceVersions": [
            "1.0-preview.2",
            "1.0-preview.1"
          ],
          "inputDescriptors": [
            {
              "id": "areaPath",
              "name": "Area path",
              "description": "Filter events to include only work items under the specified area path.",
              "inputMode": "combo",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "validation": {
                "dataType": "string"
              },
              "values": {
                "defaultValue": "",
                "possibleValues": [
                  {
                    "value": "",
                    "displayValue": "[Any]"
                  }
                ],
                "isLimitedToPossibleValues": true,
                "isReadOnly": true
              },
              "hasDynamicValueInformation": true
            },
            {
              "id": "workItemType",
              "name": "Work item type",
              "description": "Filter events to include only work items of the specified type.",
              "inputMode": "combo",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "validation": {
                "dataType": "string"
              },
              "values": {
                "defaultValue": "",
                "possibleValues": [
                  {
                    "value": "",
                    "displayValue": "[Any]"
                  }
                ],
                "isLimitedToPossibleValues": true,
                "isReadOnly": true
              },
              "hasDynamicValueInformation": true
            },
            {
              "id": "changedFields",
              "name": "Field",
              "description": "Filter events to include only work items with the specified field(s) changed.",
              "inputMode": "combo",
              "isConfidential": false,
              "useInDefaultDescription": false,
              "validation": {
                "dataType": "string"
              },
              "values": {
                "defaultValue": "",
                "possibleValues": [
                  {
                    "value": "",
                    "displayValue": "[Any]"
                  }
                ],
                "isLimitedToPossibleValues": true,
                "isReadOnly": true
              },
              "dependencyInputIds": [
                "workItemType"
              ],
              "hasDynamicValueInformation": true
            }
          ]
        }
      ],
      "inputDescriptors": [
        {
          "id": "projectId",
          "name": "Project",
          "description": "Team Project to restrict events to",
          "inputMode": "none",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "guid"
          }
        },
        {
          "id": "teamId",
          "name": "Team",
          "description": "Team that the subscription is associated with",
          "inputMode": "none",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "guid"
          }
        }
      ]
    }
  ]
}

定義

名稱 Description
EventTypeDescriptor

描述事件種類

InputDataType

取得或設定要驗證的資料類型。

InputDescriptor

描述訂用帳戶的輸入。

InputMode

應該輸入此輸入值的模式

InputValidation

描述哪些值對訂用帳戶輸入有效

InputValue

輸入單一值的相關資訊

InputValues

指定訂用帳戶輸入之可能/允許值的相關資訊

InputValuesError

與訂用帳戶輸入值相關的錯誤資訊。

Publisher

定義事件發行者的資料合約。

ReferenceLinks

表示 REST 參考連結集合的類別。

EventTypeDescriptor

描述事件種類

名稱 類型 Description
description

string

事件種類的當地語系化描述

id

string

事件種類的唯一識別碼

inputDescriptors

InputDescriptor[]

事件特定輸入

name

string

事件種類的當地語系化易記名稱

publisherId

string

這個事件種類的發行者的唯一識別碼

supportedResourceVersions

string[]

事件資源承載的支援版本。

url

string

此資源的 URL

InputDataType

取得或設定要驗證的資料類型。

名稱 類型 Description
boolean

string

表示 true 或 false 的值。

guid

string

表示 Guid。

none

string

未指定資料類型。

number

string

表示數值。

string

string

表示文字值。

uri

string

表示 URI。

InputDescriptor

描述訂用帳戶的輸入。

名稱 類型 Description
dependencyInputIds

string[]

此輸入值相依之所有輸入的識別碼。

description

string

此輸入用途的描述

groupName

string

此輸入所屬的群組當地語系化名稱,可以顯示為容器的標頭,其中包含群組中的所有輸入。

hasDynamicValueInformation

boolean

如果為 true,則此輸入的值資訊是動態的,而且應該在相依性輸入的值變更時擷取。

id

string

訂用帳戶輸入的識別碼

inputMode

InputMode

應該輸入此輸入值的模式

isConfidential

boolean

取得此輸入是否為機密,例如密碼或應用程式金鑰

name

string

當地語系化名稱,可顯示為訂用帳戶輸入的標籤

properties

object

服務提供者可以使用之輸入的自訂屬性

type

string

輸入值的基礎資料類型。 指定此值時,InputMode、Validation 和 Values 是選擇性的。

useInDefaultDescription

boolean

取得這個輸入是否包含在預設產生的動作描述中。

validation

InputValidation

用來驗證此輸入值的資訊

valueHint

string

輸入值的提示。 它可用於 UI 作為輸入預留位置。

values

InputValues

此輸入可能值的相關資訊

InputMode

應該輸入此輸入值的模式

名稱 類型 Description
checkBox

string

核取方塊應該會顯示為 true/false 值 ()

combo

string

應該顯示選取/下拉式控制項

none

string

此輸入不應該顯示在 UI 中

passwordBox

string

應該會顯示密碼輸入方塊

radioButtons

string

應該顯示選項按鈕

textArea

string

應該顯示多行文字區域

textBox

string

應該會顯示輸入文字方塊

InputValidation

描述哪些值對訂用帳戶輸入有效

名稱 類型 Description
dataType

InputDataType

取得或設定要驗證的資料類型。

isRequired

boolean

取得或設定這是必要欄位。

maxLength

integer

取得或設定這個描述元的最大長度。

maxValue

string

取得或設定這個描述元的最小值。

minLength

integer

取得或設定這個描述元的最小長度。

minValue

string

取得或設定這個描述元的最小值。

pattern

string

取得或設定要驗證的模式。

patternMismatchErrorMessage

string

取得或設定模式不符的錯誤。

InputValue

輸入單一值的相關資訊

名稱 類型 Description
data

object

關於此輸入的任何其他資料

displayValue

string

要顯示此值的文字

value

string

要儲存此輸入的值

InputValues

指定訂用帳戶輸入之可能/允許值的相關資訊

名稱 類型 Description
defaultValue

string

要用於此輸入的預設值

error

InputValuesError

計算動態值時發生錯誤。

inputId

string

輸入的識別碼

isDisabled

boolean

應停用此輸入

isLimitedToPossibleValues

boolean

如果值限制為 PossibleValues 中的其中一個值, (True) 或 PossibleValues 中的值只是建議 (False)

isReadOnly

boolean

應將此輸入設為唯讀

possibleValues

InputValue[]

此輸入可接受的可能值

InputValuesError

與訂用帳戶輸入值相關的錯誤資訊。

名稱 類型 Description
message

string

錯誤訊息。

Publisher

定義事件發行者的資料合約。

名稱 類型 Description
_links

ReferenceLinks

參考連結

description

string

取得此發行者的當地語系化描述。

id

string

取得這個發行者的識別碼。

inputDescriptors

InputDescriptor[]

發行者特定的輸入

name

string

取得這個發行者的當地語系化名稱。

serviceInstanceType

string

第一方發行者的服務實例類型。

supportedEvents

EventTypeDescriptor[]

取得此發行者的支援事件種類。

url

string

此資源的 URL

表示 REST 參考連結集合的類別。

名稱 類型 Description
links

object

連結的唯讀檢視。 因為參考連結是唯讀的,所以我們只想要將它們公開為唯讀。