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 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
organization
|
path | True |
string |
Azure DevOps 組織的名稱。 |
|
api-version
|
query | True |
string |
要使用的 API 版本。 這應該設定為 『7.1』 以使用此版本的 API。 |
|
$skip
|
query |
integer (int32) |
||
|
$top
|
query |
integer (int32) |
||
|
continuation
|
query |
integer (int32) |
指標,顯示已擷取的項目數。 |
|
|
get
|
query |
boolean |
||
|
state
|
query |
篩選特定小組項目狀態中的小組專案(預設值:WellFormed)。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
成功作業 |
安全性
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.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"
}
]
}
定義
| 名稱 | Description |
|---|---|
|
Project |
專案的目前狀態。 |
|
Project |
指出專案可看見的物件。 |
|
Team |
表示 TeamProject 的淺層參考。 |
ProjectState
專案的目前狀態。
| 值 | Description |
|---|---|
| all |
所有專案,不論狀態為何,但已刪除除外。 |
| createPending |
Project 已排入佇列以建立,但程式尚未啟動。 |
| deleted |
項目已刪除。 |
| deleting |
Project 正在刪除。 |
| new |
Project 正在建立中。 |
| unchanged |
專案尚未變更。 |
| wellFormed |
專案已完全建立並可供使用。 |
ProjectVisibility
指出專案可看見的物件。
| 值 | Description |
|---|---|
| private |
只有具有明確存取權的使用者才能看到專案。 |
| public |
所有專案都可以看到。 |
TeamProjectReference
表示 TeamProject 的淺層參考。
| 名稱 | 類型 | Description |
|---|---|---|
| abbreviation |
string |
項目縮寫。 |
| defaultTeamImageUrl |
string |
默認小組身分識別影像的 URL。 |
| description |
string |
專案的描述(如果有的話)。 |
| id |
string (uuid) |
項目標識碼。 |
| lastUpdateTime |
string (date-time) |
專案上次更新時間。 |
| name |
string |
專案名稱。 |
| revision |
integer (int64) |
專案修訂。 |
| state |
項目狀態。 |
|
| url |
string |
物件完整版本的 URL。 |
| visibility |
項目可見度。 |