此版本的 GitHub Enterprise Server 将于以下日期停止服务 2026-06-02. 即使针对重大安全问题,也不会发布补丁。 为了获得更好的性能、更高的安全性和新功能,请升级到最新版本的 GitHub Enterprise。 如需升级帮助,请联系 GitHub Enterprise 支持。
Project (classic) 列的 REST API 终结点
使用 REST API 创建和管理 项目(经典) 上的列。
Get a project column
Warning
Closing down notice: Projects (classic) is being deprecated in favor of the new Projects experience. See the changelog for more information.
“”Get a project column 的参数
| 名称, 类型, 说明 |
|---|
accept string Setting to |
| 名称, 类型, 说明 |
|---|
column_id integer 必须The unique identifier of the column. |
HTTP response status codes for "Get a project column"
| Status code | 说明 |
|---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Code samples for "Get a project column"
Request example
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/projects/columns/COLUMN_IDResponse
Status: 200{
"url": "https://HOSTNAME/projects/columns/367",
"project_url": "https://HOSTNAME/projects/120",
"cards_url": "https://HOSTNAME/projects/columns/367/cards",
"id": 367,
"node_id": "MDEzOlByb2plY3RDb2x1bW4zNjc=",
"name": "To Do",
"created_at": "2016-09-05T14:18:44Z",
"updated_at": "2016-09-05T14:22:28Z"
}Update an existing project column
Warning
Closing down notice: Projects (classic) is being deprecated in favor of the new Projects experience. See the changelog for more information.
“”Update an existing project column 的参数
| 名称, 类型, 说明 |
|---|
accept string Setting to |
| 名称, 类型, 说明 |
|---|
column_id integer 必须The unique identifier of the column. |
| 名称, 类型, 说明 |
|---|
name string 必须Name of the project column |
HTTP response status codes for "Update an existing project column"
| Status code | 说明 |
|---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Code samples for "Update an existing project column"
Request example
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/projects/columns/COLUMN_ID \
-d '{"name":"To Do"}'Response
Status: 200{
"url": "https://HOSTNAME/projects/columns/367",
"project_url": "https://HOSTNAME/projects/120",
"cards_url": "https://HOSTNAME/projects/columns/367/cards",
"id": 367,
"node_id": "MDEzOlByb2plY3RDb2x1bW4zNjc=",
"name": "To Do",
"created_at": "2016-09-05T14:18:44Z",
"updated_at": "2016-09-05T14:22:28Z"
}Delete a project column
Warning
Closing down notice: Projects (classic) is being deprecated in favor of the new Projects experience. See the changelog for more information.
“”Delete a project column 的参数
| 名称, 类型, 说明 |
|---|
accept string Setting to |
| 名称, 类型, 说明 |
|---|
column_id integer 必须The unique identifier of the column. |
HTTP response status codes for "Delete a project column"
| Status code | 说明 |
|---|---|
204 | No Content |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Code samples for "Delete a project column"
Request example
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/projects/columns/COLUMN_IDResponse
Status: 204Move a project column
Warning
Closing down notice: Projects (classic) is being deprecated in favor of the new Projects experience. See the changelog for more information.
“”Move a project column 的参数
| 名称, 类型, 说明 |
|---|
accept string Setting to |
| 名称, 类型, 说明 |
|---|
column_id integer 必须The unique identifier of the column. |
| 名称, 类型, 说明 |
|---|
position string 必须The position of the column in a project. Can be one of: |
HTTP response status codes for "Move a project column"
| Status code | 说明 |
|---|---|
201 | Created |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
422 | Validation failed, or the endpoint has been spammed. |
Code samples for "Move a project column"
Request example
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/projects/columns/COLUMN_ID/moves \
-d '{"position":"last"}'Response
Status: 201List project columns
Warning
Closing down notice: Projects (classic) is being deprecated in favor of the new Projects experience. See the changelog for more information.
“”List project columns 的参数
| 名称, 类型, 说明 |
|---|
accept string Setting to |
| 名称, 类型, 说明 |
|---|
project_id integer 必须The unique identifier of the project. |
| 名称, 类型, 说明 |
|---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." 默认: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." 默认: |
HTTP response status codes for "List project columns"
| Status code | 说明 |
|---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Code samples for "List project columns"
Request example
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/projects/PROJECT_ID/columnsResponse
Status: 200[
{
"url": "https://HOSTNAME/projects/columns/367",
"project_url": "https://HOSTNAME/projects/120",
"cards_url": "https://HOSTNAME/projects/columns/367/cards",
"id": 367,
"node_id": "MDEzOlByb2plY3RDb2x1bW4zNjc=",
"name": "To Do",
"created_at": "2016-09-05T14:18:44Z",
"updated_at": "2016-09-05T14:22:28Z"
}
]Create a project column
Warning
Closing down notice: Projects (classic) is being deprecated in favor of the new Projects experience. See the changelog for more information.
“”Create a project column 的参数
| 名称, 类型, 说明 |
|---|
accept string Setting to |
| 名称, 类型, 说明 |
|---|
project_id integer 必须The unique identifier of the project. |
| 名称, 类型, 说明 |
|---|
name string 必须Name of the project column |
HTTP response status codes for "Create a project column"
| Status code | 说明 |
|---|---|
201 | Created |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
422 | Validation failed, or the endpoint has been spammed. |
Code samples for "Create a project column"
Request example
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/projects/PROJECT_ID/columns \
-d '{"name":"Remaining tasks"}'Response
Status: 201{
"url": "https://HOSTNAME/projects/columns/367",
"project_url": "https://HOSTNAME/projects/120",
"cards_url": "https://HOSTNAME/projects/columns/367/cards",
"id": 367,
"node_id": "MDEzOlByb2plY3RDb2x1bW4zNjc=",
"name": "To Do",
"created_at": "2016-09-05T14:18:44Z",
"updated_at": "2016-09-05T14:22:28Z"
}