Teams - Create

在团队项目中创建团队。

可能的失败情况 项目名称/ID 无效 (项目不存在) 404 无效的团队名称或说明 400 团队已存在 400 权限不足 400

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

URI 参数

名称 必需 类型 说明
organization
path True

string

Azure DevOps 组织的名称。

projectId
path True

string

要在其中创建团队的团队项目的名称或 ID (GUID) 。

api-version
query True

string

要使用的 API 版本。 应将其设置为“6.0”才能使用此版本的 API。

请求正文

名称 类型 说明
description

string

团队说明

id

string

Team (Identity) Guid。 Team Foundation ID。

identity

Identity

团队标识。

identityUrl

string

此团队的标识 REST API URL

name

string

球队名称

projectId

string

projectName

string

url

string

团队 REST API URL

响应

名称 类型 说明
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

名称 说明
vso.project_manage 授予创建、读取、更新和删除项目和团队的能力。

示例

Sample Request

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

{
  "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"
}

定义

名称 说明
Identity
IdentityDescriptor

标识描述符是标识类型 (Windows SID、Passport) 以及唯一标识符(如 SID 或 PUID)的包装器。

PropertiesCollection

类将属性包表示为键值对的集合。 接受所有基元类型的值 (除 TypeCode != TypeCode.Object) 以外的 DBNull 任何类型。 Byte[]、Int32、Double、DateType 和 String 类型的值保留其类型,其他基元将重新优化为 String。 Byte[] 预期为 base64 编码字符串。

WebApiTeam

Identity

名称 类型 说明
customDisplayName

string

标识的自定义显示名称 ((如果有任何) )。 将此属性设置为空字符串将清除现有的自定义显示名称。 将此属性设置为 null 不会影响现有的持久化值 (,因为 null 值不会通过网络或发送到数据库)

descriptor

IdentityDescriptor

标识描述符是标识类型 (Windows SID、Passport) 以及唯一标识符(如 SID 或 PUID)的包装器。

id

string

标识标识符。 也称为存储密钥或 VSID

isActive

boolean

如果标识在组织中的任何 Azure Devops 组中具有成员身份,则其值为 True。

isContainer

boolean

如此 如果标识是一个组。

masterId

string

memberIds

string[]

标识 (组成员的 ID 仅) 。

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)的包装器。

名称 类型 说明
identifier

string

此标识的唯一标识符(不超过 256 个字符)将持久保存。

identityType

string

描述符 (的类型,例如 Windows、Passport 等) 。

PropertiesCollection

类将属性包表示为键值对的集合。 接受所有基元类型的值 (除 TypeCode != TypeCode.Object) 以外的 DBNull 任何类型。 Byte[]、Int32、Double、DateType 和 String 类型的值保留其类型,其他基元将重新优化为 String。 Byte[] 预期为 base64 编码字符串。

名称 类型 说明
count

integer

集合中属性的计数。

item

object

keys

string[]

集合中的键集。

values

string[]

集合中的值集。

WebApiTeam

名称 类型 说明
description

string

团队说明

id

string

Team (Identity) Guid。 Team Foundation ID。

identity

Identity

团队标识。

identityUrl

string

此团队的标识 REST API URL

name

string

球队名称

projectId

string

projectName

string

url

string

团队 REST API URL