Skip to main content
REST API теперь версия. Дополнительные сведения см. в разделе "О управлении версиями API".

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"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
project_number integer Обязательное поле

The project's number.

org string Обязательное поле

The organization name. The name is not case sensitive.

Параметры запроса
Имя., Тип, Description
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

По умолчанию.: 30

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."

Коды состояния http-ответа для "List project fields for organization"

Код состоянияОписание
200

OK

304

Not modified

401

Requires authentication

403

Forbidden

Примеры кода для "List project fields for organization"

Пример запроса

get/orgs/{org}/projectsV2/{project_number}/fields
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"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
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.

Коды состояния http-ответа для "Get project field for organization"

Код состоянияОписание
200

OK

304

Not modified

401

Requires authentication

403

Forbidden

Примеры кода для "Get project field for organization"

Пример запроса

get/orgs/{org}/projectsV2/{project_number}/fields/{field_id}
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"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
project_number integer Обязательное поле

The project's number.

username string Обязательное поле

The handle for the GitHub user account.

Параметры запроса
Имя., Тип, Description
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

По умолчанию.: 30

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."

Коды состояния http-ответа для "List project fields for user"

Код состоянияОписание
200

OK

304

Not modified

401

Requires authentication

403

Forbidden

Примеры кода для "List project fields for user"

Пример запроса

get/users/{username}/projectsV2/{project_number}/fields
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/USERNAME/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"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
project_number integer Обязательное поле

The project's number.

field_id integer Обязательное поле

The unique identifier of the field.

username string Обязательное поле

The handle for the GitHub user account.

Коды состояния http-ответа для "Get project field for user"

Код состоянияОписание
200

OK

304

Not modified

401

Requires authentication

403

Forbidden

Примеры кода для "Get project field for user"

Пример запроса

get/users/{username}/projectsV2/{project_number}/fields/{field_id}
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/USERNAME/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" }