Skip to main content
이제 REST API의 버전이 지정되었습니다. 자세한 내용은 "API 버전 관리 정보"를 참조하세요.

REST API endpoints for Project views

Use the REST API to manage Project views

Create a view for an organization-owned project

Create a new view in an organization-owned project. Views allow you to customize how items in a project are displayed and filtered.

"Create a view for an organization-owned project"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:

  • "Projects" organization permissions (write)

"Create a view for an organization-owned project"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
org string Required

The organization name. The name is not case sensitive.

project_number integer Required

The project's number.

본문 매개 변수
속성, 형식, 설명
name string Required

The name of the view.

layout string Required

The layout of the view.

다음 중 하나일 수 있습니다.: table, board, roadmap

filter string

The filter query for the view. See Filtering projects for more information.

visible_fields array of integers

visible_fields is not applicable to roadmap layout views. For table and board layouts, this represents the field IDs that should be visible in the view. If not provided, the default visible fields will be used.

"Create a view for an organization-owned project"에 대한 HTTP 응답 상태 코드

상태 코드설명
201

Response for creating a view in an organization-owned project.

304

Not modified

401

Requires authentication

403

Forbidden

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

503

Service unavailable

"Create a view for an organization-owned project"에 대한 코드 샘플

GHE.com에서 GitHub에 액세스하는 경우 api.github.comapi.SUBDOMAIN.ghe.com의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.

요청 예제

post/orgs/{org}/projectsV2/{project_number}/views
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/projectsV2/PROJECT_NUMBER/views \ -d '{"name":"All Issues","layout":"table","filter":"is:issue","visible_fields":[123,456,789]}'

Response for creating a table view

Status: 201
{ "value": { "id": 1, "number": 1, "name": "Sprint Board", "layout": "board", "node_id": "PVTV_lADOANN5s84ACbL0zgBueEI", "project_url": "https://api.github.com/orgs/octocat/projectsV2/1", "html_url": "https://github.com/orgs/octocat/projects/1/views/1", "creator": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "created_at": "2022-04-28T12:00:00Z", "updated_at": "2022-04-28T12:00:00Z", "filter": "is:issue is:open", "visible_fields": [ 123, 456, 789 ], "sort_by": [ [ 123, "asc" ], [ 456, "desc" ] ], "group_by": [ 123 ], "vertical_group_by": [ 456 ] } }

Create a view for a user-owned project

Create a new view in a user-owned project. Views allow you to customize how items in a project are displayed and filtered.

"Create a view for a user-owned project"에 대한 세분화된 액세스 토큰

이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.

"Create a view for a user-owned project"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
user_id string Required

The unique identifier of the user.

project_number integer Required

The project's number.

본문 매개 변수
속성, 형식, 설명
name string Required

The name of the view.

layout string Required

The layout of the view.

다음 중 하나일 수 있습니다.: table, board, roadmap

filter string

The filter query for the view. See Filtering projects for more information.

visible_fields array of integers

visible_fields is not applicable to roadmap layout views. For table and board layouts, this represents the field IDs that should be visible in the view. If not provided, the default visible fields will be used.

"Create a view for a user-owned project"에 대한 HTTP 응답 상태 코드

상태 코드설명
201

Response for creating a view in a user-owned project.

304

Not modified

401

Requires authentication

403

Forbidden

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

503

Service unavailable

"Create a view for a user-owned project"에 대한 코드 샘플

GHE.com에서 GitHub에 액세스하는 경우 api.github.comapi.SUBDOMAIN.ghe.com의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.

요청 예제

post/users/{user_id}/projectsV2/{project_number}/views
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/users/USER_ID/projectsV2/PROJECT_NUMBER/views \ -d '{"name":"All Issues","layout":"table","filter":"is:issue","visible_fields":[123,456,789]}'

Response for creating a table view

Status: 201
{ "value": { "id": 1, "number": 1, "name": "Sprint Board", "layout": "board", "node_id": "PVTV_lADOANN5s84ACbL0zgBueEI", "project_url": "https://api.github.com/orgs/octocat/projectsV2/1", "html_url": "https://github.com/orgs/octocat/projects/1/views/1", "creator": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "created_at": "2022-04-28T12:00:00Z", "updated_at": "2022-04-28T12:00:00Z", "filter": "is:issue is:open", "visible_fields": [ 123, 456, 789 ], "sort_by": [ [ 123, "asc" ], [ 456, "desc" ] ], "group_by": [ 123 ], "vertical_group_by": [ 456 ] } }