Skip to main content
Nous publions des mises à jour fréquentes de notre documentation, et la traduction de cette page peut encore être en cours. Pour obtenir les informations les plus actuelles, consultez la documentation anglaise.
L’API REST est maintenant versionnée. Pour plus d’informations, consultez « À propos des versions de l’API ».

Cartes Project (classic)

Utilisez l’API REST pour créer et gérer des cartes sur un projet classique.

Remarques :

  • Ces points de terminaison interagissent uniquement avec projects (classic). Pour gérer des Projects, utilisez l’API GraphQL. Pour plus d’informations, consultez « Using the API to manage Projects ».
  • Pour créer un projet classique, l’organisation, l’utilisateur ou le dépôt doit avoir au moins un projet classique.

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 « Création d’un jeton d’accès personnel ».

Get a project card

Compatible avec GitHub Apps

Paramètres pour « Get a project card »

En-têtes
Nom, Type, Description
acceptstring

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

Paramètres de chemin d’accès
Nom, Type, Description
card_idintegerObligatoire

The unique identifier of the card.

Codes d’état de la réponse HTTP pour « Get a project card »

Code d’étatDescription
200

OK

304

Not modified

401

Requires authentication

403

Forbidden

404

Resource not found

Exemples de code pour « Get a project card »

get/projects/columns/cards/{card_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/projects/columns/cards/CARD_ID

Response

Status: 200
{ "url": "https://api.github.com/projects/columns/cards/1478", "id": 1478, "node_id": "MDExOlByb2plY3RDYXJkMTQ3OA==", "note": "Add payload for delete Project column", "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": "2016-09-05T14:21:06Z", "updated_at": "2016-09-05T14:20:22Z", "archived": false, "column_url": "https://api.github.com/projects/columns/367", "content_url": "https://api.github.com/repos/api-playground/projects-test/issues/3", "project_url": "https://api.github.com/projects/120" }

Update an existing project card

Compatible avec GitHub Apps

Paramètres pour « Update an existing project card »

En-têtes
Nom, Type, Description
acceptstring

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

Paramètres de chemin d’accès
Nom, Type, Description
card_idintegerObligatoire

The unique identifier of the card.

Paramètres du corps
Nom, Type, Description
notestring or null

The project card's note

archivedboolean

Whether or not the card is archived

Codes d’état de la réponse HTTP pour « Update an existing project card »

Code d’étatDescription
200

OK

304

Not modified

401

Requires authentication

403

Forbidden

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Exemples de code pour « Update an existing project card »

patch/projects/columns/cards/{card_id}
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/cards/CARD_ID \ -d '{"note":"Add payload for delete Project column"}'

Response

Status: 200
{ "url": "https://api.github.com/projects/columns/cards/1478", "id": 1478, "node_id": "MDExOlByb2plY3RDYXJkMTQ3OA==", "note": "Add payload for delete Project column", "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": "2016-09-05T14:21:06Z", "updated_at": "2016-09-05T14:20:22Z", "archived": false, "column_url": "https://api.github.com/projects/columns/367", "content_url": "https://api.github.com/repos/api-playground/projects-test/issues/3", "project_url": "https://api.github.com/projects/120" }

Delete a project card

Compatible avec GitHub Apps

Paramètres pour « Delete a project card »

En-têtes
Nom, Type, Description
acceptstring

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

Paramètres de chemin d’accès
Nom, Type, Description
card_idintegerObligatoire

The unique identifier of the card.

Codes d’état de la réponse HTTP pour « Delete a project card »

Code d’étatDescription
204

No Content

304

Not modified

401

Requires authentication

403

Forbidden

404

Resource not found

Exemples de code pour « Delete a project card »

delete/projects/columns/cards/{card_id}
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/cards/CARD_ID

Response

Status: 204

Move a project card

Compatible avec GitHub Apps

Paramètres pour « Move a project card »

En-têtes
Nom, Type, Description
acceptstring

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

Paramètres de chemin d’accès
Nom, Type, Description
card_idintegerObligatoire

The unique identifier of the card.

Paramètres du corps
Nom, Type, Description
positionstringObligatoire

The position of the card in a column. Can be one of: top, bottom, or after:<card_id> to place after the specified card.

column_idinteger

The unique identifier of the column the card should be moved to

Codes d’état de la réponse HTTP pour « Move a project card »

Code d’étatDescription
201

Created

304

Not modified

401

Requires authentication

403

Forbidden

422

Validation failed, or the endpoint has been spammed.

503

Service Unavailable

Exemples de code pour « Move a project card »

post/projects/columns/cards/{card_id}/moves
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/cards/CARD_ID/moves \ -d '{"column_id":42,"position":"bottom"}'

Response

List project cards

Compatible avec GitHub Apps

Paramètres pour « List project cards »

En-têtes
Nom, Type, Description
acceptstring

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

Paramètres de chemin d’accès
Nom, Type, Description
column_idintegerObligatoire

The unique identifier of the column.

Paramètres de requête
Nom, Type, Description
archived_statestring

Filters the project cards that are returned by the card's state.

Default: not_archived

Peut être: all, archived, not_archived

per_pageinteger

The number of results per page (max 100).

Default: 30

pageinteger

Page number of the results to fetch.

Default: 1

Codes d’état de la réponse HTTP pour « List project cards »

Code d’étatDescription
200

OK

304

Not modified

401

Requires authentication

403

Forbidden

Exemples de code pour « List project cards »

get/projects/columns/{column_id}/cards
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/cards

Response

Status: 200
[ { "url": "https://api.github.com/projects/columns/cards/1478", "id": 1478, "node_id": "MDExOlByb2plY3RDYXJkMTQ3OA==", "note": "Add payload for delete Project column", "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": "2016-09-05T14:21:06Z", "updated_at": "2016-09-05T14:20:22Z", "archived": false, "column_url": "https://api.github.com/projects/columns/367", "content_url": "https://api.github.com/repos/api-playground/projects-test/issues/3", "project_url": "https://api.github.com/projects/120" } ]

Create a project card

Compatible avec GitHub Apps

Paramètres pour « Create a project card »

En-têtes
Nom, Type, Description
acceptstring

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

Paramètres de chemin d’accès
Nom, Type, Description
column_idintegerObligatoire

The unique identifier of the column.

Paramètres du corps
Nom, Type, Description
notestring or nullObligatoire

The project card's note

content_idintegerObligatoire

The unique identifier of the content associated with the card

content_typestringObligatoire

The piece of content associated with the card

Codes d’état de la réponse HTTP pour « Create a project card »

Code d’étatDescription
201

Created

304

Not modified

401

Requires authentication

403

Forbidden

422

Validation failed

503

Service Unavailable

Exemples de code pour « Create a project card »

post/projects/columns/{column_id}/cards
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/cards \ -d '{"note":"Add payload for delete Project column"}'

Response

Status: 201
{ "url": "https://api.github.com/projects/columns/cards/1478", "id": 1478, "node_id": "MDExOlByb2plY3RDYXJkMTQ3OA==", "note": "Add payload for delete Project column", "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": "2016-09-05T14:21:06Z", "updated_at": "2016-09-05T14:20:22Z", "archived": false, "column_url": "https://api.github.com/projects/columns/367", "content_url": "https://api.github.com/repos/api-playground/projects-test/issues/3", "project_url": "https://api.github.com/projects/120" }