Share via


Teams - Get Teams

取得小組清單。

GET https://dev.azure.com/{organization}/_apis/projects/{projectId}/teams?api-version=7.1-preview.3
GET https://dev.azure.com/{organization}/_apis/projects/{projectId}/teams?$mine={$mine}&$top={$top}&$skip={$skip}&$expandIdentity={$expandIdentity}&api-version=7.1-preview.3

URI 參數

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

string

Azure DevOps 組織的名稱。

projectId
path True

string

api-version
query True

string

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

$expandIdentity
query

boolean

值,指出是否要在結果 WebApiTeam 物件中展開識別資訊。

$mine
query

boolean

如果 true 傳回要求使用者的所有小組為成員,則傳回所有小組使用者具有讀取權限。

$skip
query

integer

int32

要略過的小組數目。

$top
query

integer

int32

要傳回的小組數目上限。

回應

名稱 類型 Description
200 OK

WebApiTeam[]

成功的作業

安全性

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.profile 授與讀取設定檔、帳戶、集合、專案、小組和其他最上層組織成品的能力。
vso.project 授與讀取專案和小組的能力。

範例

Sample Request

GET https://dev.azure.com/fabrikam/_apis/projects/eb6e4656-77fc-42a1-9181-4c6d8e9da5d1/teams?api-version=7.1-preview.3

Sample Response

{
  "value": [
    {
      "id": "564e8204-a90b-4432-883b-d4363c6125ca",
      "name": "Quality assurance",
      "url": "https://dev.azure.com/fabrikam/_apis/projects/eb6e4656-77fc-42a1-9181-4c6d8e9da5d1/teams/564e8204-a90b-4432-883b-d4363c6125ca",
      "description": "Testing staff",
      "identityUrl": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/564e8204-a90b-4432-883b-d4363c6125ca"
    },
    {
      "id": "66df9be7-3586-467b-9c5f-425b29afedfd",
      "name": "Fabrikam-Fiber-TFVC Team",
      "url": "https://dev.azure.com/fabrikam/_apis/projects/eb6e4656-77fc-42a1-9181-4c6d8e9da5d1/teams/66df9be7-3586-467b-9c5f-425b29afedfd",
      "description": "The default project team.",
      "identityUrl": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/66df9be7-3586-467b-9c5f-425b29afedfd"
    }
  ],
  "count": 2
}

定義

名稱 Description
Identity
IdentityDescriptor

身分識別描述元是識別類型的包裝函式, (Windows SID、Passport) 以及 SID 或 PUID 等唯一識別碼。

PropertiesCollection

類別會將屬性包表示為索引鍵/值組的集合。 所有基本類型的值都會 (接受任何具有 TypeCode != TypeCode.Object) DBNull 的型別。 Byte[]、Int32、Double、DateType 和 String 類型的值會保留其類型,其他基本類型則會重新調整為 String。 Byte[] 預期為 base64 編碼字串。

WebApiTeam

Identity

名稱 類型 Description
customDisplayName

string

如果有任何) ,則為身分識別的自訂顯示名稱 (。 將此屬性設定為空字串將會清除現有的自訂顯示名稱。 將此屬性設定為 null 不會影響現有的保存值 (,因為 Null 值不會透過網路傳送或傳送至資料庫)

descriptor

IdentityDescriptor

身分識別描述元是識別類型的包裝函式, (Windows SID、Passport) 以及 SID 或 PUID 等唯一識別碼。

id

string

識別識別碼。 也稱為儲存體金鑰或 VSID

isActive

boolean

如果身分識別具有組織中任何 Azure Devops 群組的成員資格,則為 True。

isContainer

boolean

如果身分識別是群組,則為 True。

masterId

string

memberIds

string[]

只有) 的身分識別 (群組成員識別碼。

memberOf

IdentityDescriptor[]

身分識別描述元是識別類型的包裝函式, (Windows SID、Passport) 以及 SID 或 PUID 等唯一識別碼。

members

IdentityDescriptor[]

身分識別描述元是識別類型的包裝函式, (Windows SID、Passport) 以及 SID 或 PUID 等唯一識別碼。

metaTypeId

integer

properties

PropertiesCollection

類別會將屬性包表示為索引鍵/值組的集合。 所有基本類型的值都會 (接受任何具有 TypeCode != TypeCode.Object) DBNull 的型別。 Byte[]、Int32、Double、DateType 和 String 類型的值會保留其類型,其他基本類型則會重新調整為 String。 Byte[] 預期為 base64 編碼字串。

providerDisplayName

string

來源識別提供者所指定之身分識別的顯示名稱。

resourceVersion

integer

socialDescriptor

string

subjectDescriptor

string

Graph 實體的主體描述元。

uniqueUserId

integer

IdentityDescriptor

身分識別描述元是識別類型的包裝函式, (Windows SID、Passport) 以及 SID 或 PUID 等唯一識別碼。

名稱 類型 Description
identifier

string

此身分識別的唯一識別碼,不超過 256 個字元,將會保存。

identityType

string

描述項的類型 (例如 Windows、Passport 等) 。

PropertiesCollection

類別會將屬性包表示為索引鍵/值組的集合。 所有基本類型的值都會 (接受任何具有 TypeCode != TypeCode.Object) DBNull 的型別。 Byte[]、Int32、Double、DateType 和 String 類型的值會保留其類型,其他基本類型則會重新調整為 String。 Byte[] 預期為 base64 編碼字串。

名稱 類型 Description
count

integer

集合中的屬性計數。

item

object

keys

string[]

集合中的索引鍵集合。

values

string[]

集合中的值集合。

WebApiTeam

名稱 類型 Description
description

string

小組描述

id

string

Team (Identity) Guid。 Team Foundation 識別碼。

identity

Identity

小組身分識別。

identityUrl

string

此小組的身分識別 REST API URL

name

string

球隊名稱

projectId

string

projectName

string

url

string

小組 REST API URL