Share via


Teams - Create

在小組專案中建立小組。

可能的失敗案例:專案名稱/識別碼 (專案不存在) 404 不正確小組名稱或描述 400 小組已經存在 400 許可權不足 400

POST https://dev.azure.com/{organization}/_apis/projects/{projectId}/teams?api-version=7.1-preview.3

URI 參數

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

string

Azure DevOps 組織的名稱。

projectId
path True

string

要在其中建立小組之小組專案的名稱或識別碼 (GUID) 。

api-version
query True

string

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

要求本文

名稱 類型 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

回應

名稱 類型 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.project_manage 授與建立、讀取、更新和刪除專案和小組的能力。

範例

Sample Request

POST https://dev.azure.com/fabrikam/_apis/projects/8e5a3cfb-fed3-46f3-8657-e3b175cd0305/teams?api-version=7.1-preview.3

{
  "name": "My new team"
}

Sample Response

{
  "id": "8e8aa4ff-848a-474a-9033-93190137c8e4",
  "name": "My New Team",
  "url": "https://dev.azure.com/fabrikam/_apis/projects/8e5a3cfb-fed3-46f3-8657-e3b175cd0305/teams/8e8aa4ff-848a-474a-9033-93190137c8e4",
  "description": "",
  "identityUrl": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/8e8aa4ff-848a-474a-9033-93190137c8e4"
}

定義

名稱 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