共用方式為


Consumers - Get

取得特定的取用者服務。 選擇性地篩選出不支援指定發行者之任何事件類型的取用者動作。

GET https://dev.azure.com/{organization}/_apis/hooks/consumers/{consumerId}?api-version=7.1
GET https://dev.azure.com/{organization}/_apis/hooks/consumers/{consumerId}?publisherId={publisherId}&api-version=7.1

URI 參數

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

string

取用者的標識碼。

organization
path True

string

Azure DevOps 組織的名稱。

api-version
query True

string

要使用的 API 版本。 這應該設定為 『7.1』 以使用此版本的 API。

publisherId
query

string

回應

名稱 類型 Description
200 OK

Consumer

成功作業

安全性

oauth2

類型: oauth2
Flow: accessCode
授權 URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
權杖 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

範圍

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

範例

範例要求

GET https://dev.azure.com/fabrikam/_apis/hooks/consumers/zendesk?api-version=7.1

範例回覆

{
  "id": "zendesk",
  "url": "https://dev.azure.com/fabrikam/_apis/hooks/consumers/zendesk",
  "name": "Zendesk",
  "description": "Zendesk is a SaaS suite that offers help desk ticketing, issue tracking, and customer service support.",
  "imageUrl": "",
  "informationUrl": "http://go.microsoft.com/fwlink/?LinkID=396756",
  "authenticationType": "external",
  "inputDescriptors": [
    {
      "id": "accountName",
      "name": "Account name",
      "description": "Zendesk account name like https://<account name>.zendesk.com",
      "inputMode": "textBox",
      "isConfidential": false,
      "useInDefaultDescription": true,
      "validation": {
        "dataType": "string",
        "isRequired": true,
        "pattern": "^([A-Za-z0-9][A-Za-z0-9\\-]{0,61}[A-Za-z0-9]|[A-Za-z0-9]{1,63})$",
        "maxLength": 63
      }
    },
    {
      "id": "username",
      "name": "User name",
      "description": "The Zendesk user name of a user who will update tickets",
      "inputMode": "textBox",
      "isConfidential": false,
      "useInDefaultDescription": false,
      "validation": {
        "dataType": "string",
        "isRequired": true,
        "pattern": "^.+\\@.+\\..+$",
        "maxLength": 254
      }
    },
    {
      "id": "apiToken",
      "name": "API token",
      "description": "The Zendesk API token (can be found in Zendesk app in Admin > Channels > API)",
      "inputMode": "passwordBox",
      "isConfidential": true,
      "useInDefaultDescription": false,
      "validation": {
        "dataType": "string",
        "isRequired": true,
        "maxLength": 100
      }
    }
  ],
  "actions": [
    {
      "id": "createPrivateComment",
      "consumerId": "zendesk",
      "url": "https://dev.azure.com/fabrikam/_apis/hooks/consumers/zendesk/actions/createPrivateComment",
      "name": "Create a private comment in a ticket",
      "description": "Create a private comment in a ticket. <a href='http://go.microsoft.com/fwlink/?LinkId=396756'>Learn more.</a>",
      "supportedEventTypes": [
        "workitem.commented"
      ],
      "supportedResourceVersions": {
        "workitem.commented": [
          "1.0-preview.1"
        ]
      },
      "inputDescriptors": []
    }
  ]
}

定義

名稱 Description
AuthenticationType

取得或設定這個取用者的驗證類型。

Consumer

定義取用者的數據合約。

ConsumerAction

定義取用者動作的數據合約。

ExternalConfigurationDescriptor

描述如何設定外部管理的訂用帳戶。

InputDataType

取得或設定要驗證的數據類型。

InputDescriptor

描述訂用帳戶的輸入。

InputMode

輸入此輸入值的模式

InputValidation

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

InputValue

輸入單一值的相關信息

InputValues

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

InputValuesError

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

ReferenceLinks

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

AuthenticationType

取得或設定這個取用者的驗證類型。

Description
external

外部設定的驗證。

none

不需要驗證。

oAuth

OAuth 驗證。

Consumer

定義取用者的數據合約。

名稱 類型 Description
_links

ReferenceLinks

參考連結

actions

ConsumerAction[]

取得此取用者的動作。

authenticationType

AuthenticationType

取得或設定這個取用者的驗證類型。

description

string

取得或設定此取用者的當地語系化描述。

externalConfiguration

ExternalConfigurationDescriptor

只有在外部設定此取用者的訂用帳戶時,才非 Null。

id

string

取得或設定這個取用者的標識碼。

imageUrl

string

取得或設定此取用者的影像 URL,如果有的話。

informationUrl

string

取得或設定此取用者的資訊 URL,如果有的話。

inputDescriptors

InputDescriptor[]

取得或設定這個取用者的輸入描述元。

name

string

取得或設定此取用者的當地語系化名稱。

url

string

此資源的 URL

ConsumerAction

定義取用者動作的數據合約。

名稱 類型 Description
_links

ReferenceLinks

參考連結

allowResourceVersionOverride

boolean

取得或設定旗標,指出建立或編輯訂用帳戶時是否可以覆寫資源版本。

consumerId

string

取得或設定這個動作所屬取用者的標識碼。

description

string

取得或設定此動作的當地語系化描述。

id

string

取得或設定此動作的識別碼。

inputDescriptors

InputDescriptor[]

取得或設定此動作的輸入描述元。

name

string

取得或設定此動作的當地語系化名稱。

supportedEventTypes

string[]

取得或設定此動作支援的事件標識碼。

supportedResourceVersions

object

取得或設定此動作支援的資源版本。

url

string

此資源的 URL

ExternalConfigurationDescriptor

描述如何設定外部管理的訂用帳戶。

名稱 類型 Description
createSubscriptionUrl

string

要建立此訂用帳戶類型的網站 URL。

editSubscriptionPropertyName

string

輸入屬性的名稱,其中包含要編輯訂閱的URL。

hostedOnly

boolean

如果外部組態僅適用於裝載,則為 True。

InputDataType

取得或設定要驗證的數據類型。

Description
boolean

表示 true 或 false 的值。

guid

表示 Guid。

none

未指定任何數據類型。

number

表示數值。

string

表示文字值。

uri

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

應顯示複選框(針對 true/false 值)

combo

應該顯示選取/組合控制件

none

UI 中不應顯示此輸入

passwordBox

應顯示密碼輸入方塊

radioButtons

應顯示單選按鈕

textArea

應該顯示多行文字區域

textBox

應顯示輸入文字框

InputValidation

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

名稱 類型 Description
dataType

InputDataType

取得或設定要驗證的數據類型。

isRequired

boolean

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

maxLength

integer (int32)

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

maxValue

string (decimal)

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

minLength

integer (int32)

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

minValue

string (decimal)

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

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

錯誤訊息。

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

名稱 類型 Description
links

object

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