Projects - List

获取组织中经过身份验证的用户有权访问的所有项目。

GET https://dev.azure.com/{organization}/_apis/projects?api-version=7.1
GET https://dev.azure.com/{organization}/_apis/projects?stateFilter={stateFilter}&$top={$top}&$skip={$skip}&continuationToken={continuationToken}&getDefaultTeamImageUrl={getDefaultTeamImageUrl}&api-version=7.1

URI 参数

名称 必需 类型 说明
organization
path True

string

Azure DevOps 组织的名称。

api-version
query True

string

要使用的 API 版本。 这应设置为“7.1”才能使用此版本的 API。

$skip
query

integer (int32)

$top
query

integer (int32)

continuationToken
query

integer (int32)

显示已提取的项目数的指针。

getDefaultTeamImageUrl
query

boolean

stateFilter
query

ProjectState

筛选特定团队项目状态中的团队项目(默认值:WellFormed)。

响应

名称 类型 说明
200 OK

TeamProjectReference[]

成功作

安全性

oauth2

类型: oauth2
流向: 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

作用域

名称 说明
vso.profile 授予读取配置文件、帐户、集合、项目、团队和其他顶级组织项目的能力。
vso.project 授予读取项目和团队的能力。

示例

示例请求

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

示例响应

{
  "count": 3,
  "value": [
    {
      "id": "eb6e4656-77fc-42a1-9181-4c6d8e9da5d1",
      "name": "Fabrikam-Fiber-TFVC",
      "description": "Team Foundation Version Control projects.",
      "url": "https://dev.azure.com/fabrikam/_apis/projects/eb6e4656-77fc-42a1-9181-4c6d8e9da5d1",
      "state": "wellFormed"
    },
    {
      "id": "6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c",
      "name": "Fabrikam-Fiber-Git",
      "description": "Git projects",
      "url": "https://dev.azure.com/fabrikam/_apis/projects/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c",
      "state": "wellFormed"
    },
    {
      "id": "281f9a5b-af0d-49b4-a1df-fe6f5e5f84d0",
      "name": "TestGit",
      "url": "https://dev.azure.com/fabrikam/_apis/projects/281f9a5b-af0d-49b4-a1df-fe6f5e5f84d0",
      "state": "wellFormed"
    }
  ]
}

定义

名称 说明
ProjectState

项目的当前状态。

ProjectVisibility

指示项目对谁可见。

TeamProjectReference

表示对 TeamProject 的浅表引用。

ProjectState

项目的当前状态。

说明
all

所有项目,无论状态如何,都已删除。

createPending

项目已排队创建,但该过程尚未启动。

deleted

项目已被删除。

deleting

项目正在删除。

new

正在创建项目。

unchanged

项目尚未更改。

wellFormed

项目已完全创建并可供使用。

ProjectVisibility

指示项目对谁可见。

说明
private

只有具有显式访问权限的用户才能看到该项目。

public

项目对所有人可见。

TeamProjectReference

表示对 TeamProject 的浅表引用。

名称 类型 说明
abbreviation

string

项目缩写。

defaultTeamImageUrl

string

指向默认团队标识映像的 URL。

description

string

项目的说明(如果有)。

id

string (uuid)

项目标识符。

lastUpdateTime

string (date-time)

上次更新时间的项目。

name

string

项目名称。

revision

integer (int64)

项目修订。

state

ProjectState

项目状态。

url

string

指向对象完整版本的 URL。

visibility

ProjectVisibility

项目可见性。