REST API 现已开始进行版本化。 有关详细信息,请参阅“关于 API 版本控制”。
REST API endpoints for issue types
Use the REST API to manage issue types for a repository.
List issue types for a repository
Lists issue types available for a repository (inherited from its organization owner, with any per-repository overrides applied).
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
Fine-grained access tokens require the "Metadata" repository permission (read).
“List issue types for a repository”的细粒度访问令牌
此端点支持以下精细令牌类型:
细粒度令牌必须具有以下权限集:
- "Metadata" repository permissions (read)
如果仅请求公共资源,则无需身份验证或上述权限即可使用此终结点。
“”List issue types for a repository 的参数
| 名称, 类型, 说明 |
|---|
accept string Setting to |
| 名称, 类型, 说明 |
|---|
owner string 必须The account owner of the repository. The name is not case sensitive. |
repo string 必须The name of the repository without the |
“List issue types for a repository”的 HTTP 响应状态代码
| 状态代码 | 说明 |
|---|---|
200 | OK |
404 | Resource not found |
“List issue types for a repository”的代码示例
请求示例
get /repos /{owner} /{repo} /issue-types
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/repos/OWNER/REPO/issue-typesResponse
Status: 200[
{
"id": 410,
"node_id": "IT_kwDNAd3NAZo",
"name": "Task",
"description": "A specific piece of work",
"created_at": "2024-12-11T14:39:09Z",
"updated_at": "2024-12-11T14:39:09Z"
},
{
"id": 411,
"node_id": "IT_kwDNAd3NAZs",
"name": "Bug",
"description": "An unexpected problem or behavior",
"created_at": "2024-12-11T14:39:09Z",
"updated_at": "2024-12-11T14:39:09Z"
}
]