Points de terminaison d’API REST pour les colonnes Project (classic)
Utilisez l’API REST pour créer et gérer des colonnes sur un projet (classique).
Note
Projects (classic) has been retired. Vous pouvez en savoir plus sur cette modification sur the GitHub Blog.
La nouvelle expérience Projets améliorée est disponible. Pour plus d’informations, consultez « À propos des Projects ».
Ces points de terminaison interagissent uniquement avec projects (classic). Pour gérer des Projects, utilisez l’API GraphQL. Pour plus d’informations, consultez « Utilisation de l’API pour gérer des Projects ».
Note
L’API REST permettant de gérer des projects (classic) prend uniquement en charge l’authentification à l’aide d’un personal access token (classic). Pour plus d’informations, consultez « Gestion de vos jetons d'accès personnels ».
Get a project column
Warning
Closing down notice: Projects (classic) is being deprecated in favor of the new Projects experience. See the changelog for more information.
Jetons d’accès affinés pour « Get a project column »
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 au moins l’un des ensembles d’autorisations suivants:
- "Projects" repository permissions (read)
- "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 a project column »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
column_id integer ObligatoireThe unique identifier of the column. |
Codes d’état de la réponse HTTP pour « Get a project column »
Code d’état | Description |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « Get a project column »
Si vous accédez à GitHub à GHE.com, remplacez api.github.com
par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com
.
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/projects/columns/COLUMN_ID
Response
Status: 200
{
"url": "https://api.github.com/projects/columns/367",
"project_url": "https://api.github.com/projects/120",
"cards_url": "https://api.github.com/projects/columns/367/cards",
"id": 367,
"node_id": "MDEzOlByb2plY3RDb2x1bW4zNjc=",
"name": "To Do",
"created_at": "2016-09-05T14:18:44Z",
"updated_at": "2016-09-05T14:22:28Z"
}
Update an existing project column
Warning
Closing down notice: Projects (classic) is being deprecated in favor of the new Projects experience. See the changelog for more information.
Jetons d’accès affinés pour « Update an existing project column »
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 au moins l’un des ensembles d’autorisations suivants:
- "Projects" repository permissions (write)
- "Projects" organization permissions (write)
Paramètres pour « Update an existing project column »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
column_id integer ObligatoireThe unique identifier of the column. |
Nom, Type, Description |
---|
name string ObligatoireName of the project column |
Codes d’état de la réponse HTTP pour « Update an existing project column »
Code d’état | Description |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Exemples de code pour « Update an existing project column »
Si vous accédez à GitHub à GHE.com, remplacez api.github.com
par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com
.
Exemple de requête
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/projects/columns/COLUMN_ID \
-d '{"name":"To Do"}'
Response
Status: 200
{
"url": "https://api.github.com/projects/columns/367",
"project_url": "https://api.github.com/projects/120",
"cards_url": "https://api.github.com/projects/columns/367/cards",
"id": 367,
"node_id": "MDEzOlByb2plY3RDb2x1bW4zNjc=",
"name": "To Do",
"created_at": "2016-09-05T14:18:44Z",
"updated_at": "2016-09-05T14:22:28Z"
}
Delete a project column
Warning
Closing down notice: Projects (classic) is being deprecated in favor of the new Projects experience. See the changelog for more information.
Jetons d’accès affinés pour « Delete a project column »
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 au moins l’un des ensembles d’autorisations suivants:
- "Projects" repository permissions (write)
- "Projects" organization permissions (write)
Paramètres pour « Delete a project column »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
column_id integer ObligatoireThe unique identifier of the column. |
Codes d’état de la réponse HTTP pour « Delete a project column »
Code d’état | Description |
---|---|
204 | No Content |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Exemples de code pour « Delete a project column »
Si vous accédez à GitHub à GHE.com, remplacez api.github.com
par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com
.
Exemple de requête
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/projects/columns/COLUMN_ID
Response
Status: 204
Move a project column
Warning
Closing down notice: Projects (classic) is being deprecated in favor of the new Projects experience. See the changelog for more information.
Jetons d’accès affinés pour « Move a project column »
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 au moins l’un des ensembles d’autorisations suivants:
- "Projects" repository permissions (write)
- "Projects" organization permissions (write)
Paramètres pour « Move a project column »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
column_id integer ObligatoireThe unique identifier of the column. |
Nom, Type, Description |
---|
position string ObligatoireThe position of the column in a project. Can be one of: |
Codes d’état de la réponse HTTP pour « Move a project column »
Code d’état | Description |
---|---|
201 | Created |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
422 | Validation failed, or the endpoint has been spammed. |
Exemples de code pour « Move a project column »
Si vous accédez à GitHub à GHE.com, remplacez api.github.com
par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com
.
Exemple de requête
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/projects/columns/COLUMN_ID/moves \
-d '{"position":"last"}'
Response
Status: 201
List project columns
Warning
Closing down notice: Projects (classic) is being deprecated in favor of the new Projects experience. See the changelog for more information.
Jetons d’accès affinés pour « List project columns »
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 au moins l’un des ensembles d’autorisations suivants:
- "Projects" repository permissions (read)
- "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 columns »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
project_id integer ObligatoireThe unique identifier of the project. |
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: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Default: |
Codes d’état de la réponse HTTP pour « List project columns »
Code d’état | Description |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Exemples de code pour « List project columns »
Si vous accédez à GitHub à GHE.com, remplacez api.github.com
par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com
.
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/projects/PROJECT_ID/columns
Response
Status: 200
[
{
"url": "https://api.github.com/projects/columns/367",
"project_url": "https://api.github.com/projects/120",
"cards_url": "https://api.github.com/projects/columns/367/cards",
"id": 367,
"node_id": "MDEzOlByb2plY3RDb2x1bW4zNjc=",
"name": "To Do",
"created_at": "2016-09-05T14:18:44Z",
"updated_at": "2016-09-05T14:22:28Z"
}
]
Create a project column
Warning
Closing down notice: Projects (classic) is being deprecated in favor of the new Projects experience. See the changelog for more information.
Jetons d’accès affinés pour « Create a project column »
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 au moins l’un des ensembles d’autorisations suivants:
- "Projects" repository permissions (write)
- "Projects" organization permissions (write)
Paramètres pour « Create a project column »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
project_id integer ObligatoireThe unique identifier of the project. |
Nom, Type, Description |
---|
name string ObligatoireName of the project column |
Codes d’état de la réponse HTTP pour « Create a project column »
Code d’état | Description |
---|---|
201 | Created |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
422 | Validation failed, or the endpoint has been spammed. |
Exemples de code pour « Create a project column »
Si vous accédez à GitHub à GHE.com, remplacez api.github.com
par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com
.
Exemple de requête
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/projects/PROJECT_ID/columns \
-d '{"name":"Remaining tasks"}'
Response
Status: 201
{
"url": "https://api.github.com/projects/columns/367",
"project_url": "https://api.github.com/projects/120",
"cards_url": "https://api.github.com/projects/columns/367/cards",
"id": 367,
"node_id": "MDEzOlByb2plY3RDb2x1bW4zNjc=",
"name": "To Do",
"created_at": "2016-09-05T14:18:44Z",
"updated_at": "2016-09-05T14:22:28Z"
}