REST API endpoints for Project fields
Use the REST API to manage Project fields
List project fields for organization
List all fields for a specific organization-owned project.
"List project fields for organization" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Projects" organization permissions (read)
このエンドポイントは、パブリック リソースのみが要求される場合は、認証または前述メンションアクセス許可なしで使用できます。
"List project fields for organization" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
project_number integer 必須The project's number. |
org string 必須The organization name. The name is not case sensitive. |
名前, Type, 説明 |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Default: |
before string A cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API." |
after string A cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API." |
"List project fields for organization" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
"List project fields for organization" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com
を api.SUBDOMAIN.ghe.com
にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
-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/fields
Response
Status: 200
{
"id": 12345,
"node_id": "PVTF_lADOABCD1234567890",
"name": "Priority",
"data_type": "single_select",
"project_url": "https://api.github.com/projects/67890",
"options": [
{
"id": "option_1",
"name": "Low",
"color": "GREEN",
"description": "Low priority items"
},
{
"id": "option_2",
"name": "Medium",
"color": "YELLOW",
"description": "Medium priority items"
},
{
"id": "option_3",
"name": "High",
"color": "RED",
"description": "High priority items"
}
],
"created_at": "2022-04-28T12:00:00Z",
"updated_at": "2022-04-28T12:00:00Z"
}
Get project field for organization
Get a specific field for an organization-owned project.
"Get project field for organization" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Projects" organization permissions (read)
このエンドポイントは、パブリック リソースのみが要求される場合は、認証または前述メンションアクセス許可なしで使用できます。
"Get project field for organization" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
project_number integer 必須The project's number. |
field_id integer 必須The unique identifier of the field. |
org string 必須The organization name. The name is not case sensitive. |
"Get project field for organization" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
"Get project field for organization" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com
を api.SUBDOMAIN.ghe.com
にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
-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/fields/FIELD_ID
Response
Status: 200
{
"id": 12345,
"node_id": "PVTF_lADOABCD1234567890",
"name": "Priority",
"data_type": "single_select",
"project_url": "https://api.github.com/projects/67890",
"options": [
{
"id": "option_1",
"name": "Low",
"color": "GREEN",
"description": "Low priority items"
},
{
"id": "option_2",
"name": "Medium",
"color": "YELLOW",
"description": "Medium priority items"
},
{
"id": "option_3",
"name": "High",
"color": "RED",
"description": "High priority items"
}
],
"created_at": "2022-04-28T12:00:00Z",
"updated_at": "2022-04-28T12:00:00Z"
}
List project fields for user
List all fields for a specific user-owned project.
"List project fields for user" のきめ細かいアクセス トークン
このエンドポイントは、GitHub アプリのユーザー アクセス トークン、GitHub アプリのインストール アクセス トークン、またはきめ細かい個人用アクセス トークンでは機能しません。
"List project fields for user" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
project_number integer 必須The project's number. |
user_id string 必須The unique identifier of the user. |
名前, Type, 説明 |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Default: |
before string A cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API." |
after string A cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API." |
"List project fields for user" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
"List project fields for user" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com
を api.SUBDOMAIN.ghe.com
にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
-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/fields
Response
Status: 200
{
"id": 12345,
"node_id": "PVTF_lADOABCD1234567890",
"name": "Priority",
"data_type": "single_select",
"project_url": "https://api.github.com/projects/67890",
"options": [
{
"id": "option_1",
"name": "Low",
"color": "GREEN",
"description": "Low priority items"
},
{
"id": "option_2",
"name": "Medium",
"color": "YELLOW",
"description": "Medium priority items"
},
{
"id": "option_3",
"name": "High",
"color": "RED",
"description": "High priority items"
}
],
"created_at": "2022-04-28T12:00:00Z",
"updated_at": "2022-04-28T12:00:00Z"
}
Get project field for user
Get a specific field for a user-owned project.
"Get project field for user" のきめ細かいアクセス トークン
このエンドポイントは、GitHub アプリのユーザー アクセス トークン、GitHub アプリのインストール アクセス トークン、またはきめ細かい個人用アクセス トークンでは機能しません。
"Get project field for user" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
project_number integer 必須The project's number. |
field_id integer 必須The unique identifier of the field. |
user_id string 必須The unique identifier of the user. |
"Get project field for user" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
"Get project field for user" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com
を api.SUBDOMAIN.ghe.com
にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
-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/fields/FIELD_ID
Response
Status: 200
{
"id": 12345,
"node_id": "PVTF_lADOABCD1234567890",
"name": "Priority",
"data_type": "single_select",
"project_url": "https://api.github.com/projects/67890",
"options": [
{
"id": "option_1",
"name": "Low",
"color": "GREEN",
"description": "Low priority items"
},
{
"id": "option_2",
"name": "Medium",
"color": "YELLOW",
"description": "Medium priority items"
},
{
"id": "option_3",
"name": "High",
"color": "RED",
"description": "High priority items"
}
],
"created_at": "2022-04-28T12:00:00Z",
"updated_at": "2022-04-28T12:00:00Z"
}