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.
Jetons d’accès affinés pour « List project fields for organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Projects" organization permissions (read)
Ce point de terminaison peut être utilisé sans authentification ou sans les autorisations mentionnées ci-dessus si seules les ressources publiques sont demandées.
Paramètres pour « List project fields for organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
project_number integer ObligatoireThe project's number. |
org string ObligatoireThe organization name. The name is not case sensitive. |
Nom, Type, Description |
---|
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." |
Codes d’état de la réponse HTTP pour « List project fields for organization »
Code d’état | Description |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Exemples de code pour « List project fields for organization »
Exemple de requête
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.
Jetons d’accès affinés pour « Get project field for organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Projects" organization permissions (read)
Ce point de terminaison peut être utilisé sans authentification ou sans les autorisations mentionnées ci-dessus si seules les ressources publiques sont demandées.
Paramètres pour « Get project field for organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
project_number integer ObligatoireThe project's number. |
field_id integer ObligatoireThe unique identifier of the field. |
org string ObligatoireThe organization name. The name is not case sensitive. |
Codes d’état de la réponse HTTP pour « Get project field for organization »
Code d’état | Description |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Exemples de code pour « Get project field for organization »
Exemple de requête
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.
Jetons d’accès affinés pour « List project fields for user »
Ce point de terminaison ne fonctionne pas avec les jetons d’accès utilisateur d’application GitHub, les jetons d’accès d’installation d’application GitHub ou les jetons d’accès personnels affinés.
Paramètres pour « List project fields for user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
project_number integer ObligatoireThe project's number. |
user_id string ObligatoireThe unique identifier of the user. |
Nom, Type, Description |
---|
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." |
Codes d’état de la réponse HTTP pour « List project fields for user »
Code d’état | Description |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Exemples de code pour « List project fields for user »
Exemple de requête
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.
Jetons d’accès affinés pour « Get project field for user »
Ce point de terminaison ne fonctionne pas avec les jetons d’accès utilisateur d’application GitHub, les jetons d’accès d’installation d’application GitHub ou les jetons d’accès personnels affinés.
Paramètres pour « Get project field for user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
project_number integer ObligatoireThe project's number. |
field_id integer ObligatoireThe unique identifier of the field. |
user_id string ObligatoireThe unique identifier of the user. |
Codes d’état de la réponse HTTP pour « Get project field for user »
Code d’état | Description |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Exemples de code pour « Get project field for user »
Exemple de requête
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"
}