Skip to main content

Esta versión de GitHub Enterprise se discontinuó el 2022-10-12. No se realizarán lanzamientos de patch, ni siquiera para problemas de seguridad críticos. Para obtener rendimiento mejorado, seguridad mejorada y nuevas características, actualice a la versión más reciente de GitHub Enterprise. Para obtener ayuda con la actualización, póngase en contacto con el soporte técnico de GitHub Enterprise.

Comentarios de debates de equipo

La API de Comentarios de debate de equipo permite obtener, crear, editar y eliminar los comentarios del debate en una publicación de un debate de equipo.

Acerca de la API de comentarios de debates de equipo

Cualquier miembro de la organización del equipo puede crear y leer los comentarios de un debate público. Para obtener más información, vea "Acerca de los debates de equipo".

Esta API solo está disponible para los miembros autenticados de la organización del equipo. Los tokens de acceso de OAuth necesitan el ámbito read:org. GitHub genera el valor slug del equipo a partir del valor name del equipo.

List discussion comments

Funciona con GitHub Apps

List all comments on a team discussion. OAuth access tokens require the read:discussion scope.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments.

Parámetros

Headers
Name, Type, Description
acceptstring

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

See preview notice
Path parameters
Name, Type, Description
orgstringRequired

The organization name. The name is not case sensitive.

team_slugstringRequired

The slug of the team name.

discussion_numberintegerRequired

The number that identifies the discussion.

Query parameters
Name, Type, Description
directionstring

The direction to sort the results by.

Default: desc

Can be one of: asc, desc

per_pageinteger

The number of results per page (max 100).

Default: 30

pageinteger

Page number of the results to fetch.

Default: 1

Códigos de estado de respuesta HTTP

status codeDescripción
200

OK

Ejemplos de código

get/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/DISCUSSION_NUMBER/comments

Response

Status: 200
[ { "author": { "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 }, "body": "Do you like apples?", "body_html": "<p>Do you like apples?</p>", "body_version": "5eb32b219cdc6a5a9b29ba5d6caa9c51", "created_at": "2018-01-15T23:53:58Z", "last_edited_at": null, "discussion_url": "https://api.github.com/teams/2403582/discussions/1", "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1", "node_id": "MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=", "number": 1, "updated_at": "2018-01-15T23:53:58Z", "url": "https://api.github.com/teams/2403582/discussions/1/comments/1", "reactions": { "url": "https://api.github.com/teams/2403582/discussions/1/reactions", "total_count": 5, "+1": 3, "-1": 1, "laugh": 0, "confused": 0, "heart": 1, "hooray": 0, "eyes": 1, "rocket": 1 } } ]

Aviso de previsualización

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Create a discussion comment

Funciona con GitHub Apps

Creates a new comment on a team discussion. OAuth access tokens require the write:discussion scope.

This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See "Secondary rate limits" and "Dealing with secondary rate limits" for details.

Note: You can also specify a team by org_id and team_id using the route POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments.

Parámetros

Headers
Name, Type, Description
acceptstring

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

See preview notice
Path parameters
Name, Type, Description
orgstringRequired

The organization name. The name is not case sensitive.

team_slugstringRequired

The slug of the team name.

discussion_numberintegerRequired

The number that identifies the discussion.

Body parameters
Name, Type, Description
bodystringRequired

The discussion comment's body text.

Códigos de estado de respuesta HTTP

status codeDescripción
201

Created

Ejemplos de código

post/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments
curl \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/DISCUSSION_NUMBER/comments \ -d '{"body":"Do you like apples?"}'

Response

Status: 201
{ "author": { "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 }, "body": "Do you like apples?", "body_html": "<p>Do you like apples?</p>", "body_version": "5eb32b219cdc6a5a9b29ba5d6caa9c51", "created_at": "2018-01-15T23:53:58Z", "last_edited_at": null, "discussion_url": "https://api.github.com/teams/2403582/discussions/1", "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1", "node_id": "MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=", "number": 1, "updated_at": "2018-01-15T23:53:58Z", "url": "https://api.github.com/teams/2403582/discussions/1/comments/1", "reactions": { "url": "https://api.github.com/teams/2403582/discussions/1/reactions", "total_count": 5, "+1": 3, "-1": 1, "laugh": 0, "confused": 0, "heart": 1, "hooray": 0, "eyes": 1, "rocket": 1 } }

Aviso de previsualización

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Get a discussion comment

Funciona con GitHub Apps

Get a specific comment on a team discussion. OAuth access tokens require the read:discussion scope.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}.

Parámetros

Headers
Name, Type, Description
acceptstring

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

See preview notice
Path parameters
Name, Type, Description
orgstringRequired

The organization name. The name is not case sensitive.

team_slugstringRequired

The slug of the team name.

discussion_numberintegerRequired

The number that identifies the discussion.

comment_numberintegerRequired

The number that identifies the comment.

Códigos de estado de respuesta HTTP

status codeDescripción
200

OK

Ejemplos de código

get/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/DISCUSSION_NUMBER/comments/COMMENT_NUMBER

Response

Status: 200
{ "author": { "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 }, "body": "Do you like apples?", "body_html": "<p>Do you like apples?</p>", "body_version": "5eb32b219cdc6a5a9b29ba5d6caa9c51", "created_at": "2018-01-15T23:53:58Z", "last_edited_at": null, "discussion_url": "https://api.github.com/teams/2403582/discussions/1", "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1", "node_id": "MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=", "number": 1, "updated_at": "2018-01-15T23:53:58Z", "url": "https://api.github.com/teams/2403582/discussions/1/comments/1", "reactions": { "url": "https://api.github.com/teams/2403582/discussions/1/reactions", "total_count": 5, "+1": 3, "-1": 1, "laugh": 0, "confused": 0, "heart": 1, "hooray": 0, "eyes": 1, "rocket": 1 } }

Aviso de previsualización

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Update a discussion comment

Funciona con GitHub Apps

Edits the body text of a discussion comment. OAuth access tokens require the write:discussion scope.

Note: You can also specify a team by org_id and team_id using the route PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}.

Parámetros

Headers
Name, Type, Description
acceptstring

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

See preview notice
Path parameters
Name, Type, Description
orgstringRequired

The organization name. The name is not case sensitive.

team_slugstringRequired

The slug of the team name.

discussion_numberintegerRequired

The number that identifies the discussion.

comment_numberintegerRequired

The number that identifies the comment.

Body parameters
Name, Type, Description
bodystringRequired

The discussion comment's body text.

Códigos de estado de respuesta HTTP

status codeDescripción
200

OK

Ejemplos de código

patch/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}
curl \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/DISCUSSION_NUMBER/comments/COMMENT_NUMBER \ -d '{"body":"Do you like pineapples?"}'

Response

Status: 200
{ "author": { "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 }, "body": "Do you like pineapples?", "body_html": "<p>Do you like pineapples?</p>", "body_version": "e6907b24d9c93cc0c5024a7af5888116", "created_at": "2018-01-15T23:53:58Z", "last_edited_at": "2018-01-26T18:22:20Z", "discussion_url": "https://api.github.com/teams/2403582/discussions/1", "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1", "node_id": "MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=", "number": 1, "updated_at": "2018-01-26T18:22:20Z", "url": "https://api.github.com/teams/2403582/discussions/1/comments/1", "reactions": { "url": "https://api.github.com/teams/2403582/discussions/1/reactions", "total_count": 5, "+1": 3, "-1": 1, "laugh": 0, "confused": 0, "heart": 1, "hooray": 0, "eyes": 1, "rocket": 1 } }

Aviso de previsualización

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Delete a discussion comment

Funciona con GitHub Apps

Deletes a comment on a team discussion. OAuth access tokens require the write:discussion scope.

Note: You can also specify a team by org_id and team_id using the route DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}.

Parámetros

Headers
Name, Type, Description
acceptstring

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

Path parameters
Name, Type, Description
orgstringRequired

The organization name. The name is not case sensitive.

team_slugstringRequired

The slug of the team name.

discussion_numberintegerRequired

The number that identifies the discussion.

comment_numberintegerRequired

The number that identifies the comment.

Códigos de estado de respuesta HTTP

status codeDescripción
204

No Content

Ejemplos de código

delete/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}
curl \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/DISCUSSION_NUMBER/comments/COMMENT_NUMBER

Response

Status: 204

List discussion comments (Legacy)

Funciona con GitHub Apps

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List discussion comments endpoint.

List all comments on a team discussion. OAuth access tokens require the read:discussion scope.

Parámetros

Headers
Name, Type, Description
acceptstring

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

See preview notice
Path parameters
Name, Type, Description
team_idintegerRequired

The unique identifier of the team.

discussion_numberintegerRequired

The number that identifies the discussion.

Query parameters
Name, Type, Description
directionstring

The direction to sort the results by.

Default: desc

Can be one of: asc, desc

per_pageinteger

The number of results per page (max 100).

Default: 30

pageinteger

Page number of the results to fetch.

Default: 1

Códigos de estado de respuesta HTTP

status codeDescripción
200

OK

Ejemplos de código

get/teams/{team_id}/discussions/{discussion_number}/comments
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/teams/TEAM_ID/discussions/DISCUSSION_NUMBER/comments

Response

Status: 200
[ { "author": { "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 }, "body": "Do you like apples?", "body_html": "<p>Do you like apples?</p>", "body_version": "5eb32b219cdc6a5a9b29ba5d6caa9c51", "created_at": "2018-01-15T23:53:58Z", "last_edited_at": null, "discussion_url": "https://api.github.com/teams/2403582/discussions/1", "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1", "node_id": "MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=", "number": 1, "updated_at": "2018-01-15T23:53:58Z", "url": "https://api.github.com/teams/2403582/discussions/1/comments/1", "reactions": { "url": "https://api.github.com/teams/2403582/discussions/1/reactions", "total_count": 5, "+1": 3, "-1": 1, "laugh": 0, "confused": 0, "heart": 1, "hooray": 0, "eyes": 1, "rocket": 1 } } ]

Aviso de previsualización

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Create a discussion comment (Legacy)

Funciona con GitHub Apps

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Create a discussion comment endpoint.

Creates a new comment on a team discussion. OAuth access tokens require the write:discussion scope.

This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See "Secondary rate limits" and "Dealing with secondary rate limits" for details.

Parámetros

Headers
Name, Type, Description
acceptstring

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

See preview notice
Path parameters
Name, Type, Description
team_idintegerRequired

The unique identifier of the team.

discussion_numberintegerRequired

The number that identifies the discussion.

Body parameters
Name, Type, Description
bodystringRequired

The discussion comment's body text.

Códigos de estado de respuesta HTTP

status codeDescripción
201

Created

Ejemplos de código

post/teams/{team_id}/discussions/{discussion_number}/comments
curl \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/teams/TEAM_ID/discussions/DISCUSSION_NUMBER/comments \ -d '{"body":"Do you like apples?"}'

Response

Status: 201
{ "author": { "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 }, "body": "Do you like apples?", "body_html": "<p>Do you like apples?</p>", "body_version": "5eb32b219cdc6a5a9b29ba5d6caa9c51", "created_at": "2018-01-15T23:53:58Z", "last_edited_at": null, "discussion_url": "https://api.github.com/teams/2403582/discussions/1", "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1", "node_id": "MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=", "number": 1, "updated_at": "2018-01-15T23:53:58Z", "url": "https://api.github.com/teams/2403582/discussions/1/comments/1", "reactions": { "url": "https://api.github.com/teams/2403582/discussions/1/reactions", "total_count": 5, "+1": 3, "-1": 1, "laugh": 0, "confused": 0, "heart": 1, "hooray": 0, "eyes": 1, "rocket": 1 } }

Aviso de previsualización

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Get a discussion comment (Legacy)

Funciona con GitHub Apps

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Get a discussion comment endpoint.

Get a specific comment on a team discussion. OAuth access tokens require the read:discussion scope.

Parámetros

Headers
Name, Type, Description
acceptstring

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

See preview notice
Path parameters
Name, Type, Description
team_idintegerRequired

The unique identifier of the team.

discussion_numberintegerRequired

The number that identifies the discussion.

comment_numberintegerRequired

The number that identifies the comment.

Códigos de estado de respuesta HTTP

status codeDescripción
200

OK

Ejemplos de código

get/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/teams/TEAM_ID/discussions/DISCUSSION_NUMBER/comments/COMMENT_NUMBER

Response

Status: 200
{ "author": { "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 }, "body": "Do you like apples?", "body_html": "<p>Do you like apples?</p>", "body_version": "5eb32b219cdc6a5a9b29ba5d6caa9c51", "created_at": "2018-01-15T23:53:58Z", "last_edited_at": null, "discussion_url": "https://api.github.com/teams/2403582/discussions/1", "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1", "node_id": "MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=", "number": 1, "updated_at": "2018-01-15T23:53:58Z", "url": "https://api.github.com/teams/2403582/discussions/1/comments/1", "reactions": { "url": "https://api.github.com/teams/2403582/discussions/1/reactions", "total_count": 5, "+1": 3, "-1": 1, "laugh": 0, "confused": 0, "heart": 1, "hooray": 0, "eyes": 1, "rocket": 1 } }

Aviso de previsualización

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Update a discussion comment (Legacy)

Funciona con GitHub Apps

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Update a discussion comment endpoint.

Edits the body text of a discussion comment. OAuth access tokens require the write:discussion scope.

Parámetros

Headers
Name, Type, Description
acceptstring

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

See preview notice
Path parameters
Name, Type, Description
team_idintegerRequired

The unique identifier of the team.

discussion_numberintegerRequired

The number that identifies the discussion.

comment_numberintegerRequired

The number that identifies the comment.

Body parameters
Name, Type, Description
bodystringRequired

The discussion comment's body text.

Códigos de estado de respuesta HTTP

status codeDescripción
200

OK

Ejemplos de código

patch/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}
curl \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/teams/TEAM_ID/discussions/DISCUSSION_NUMBER/comments/COMMENT_NUMBER \ -d '{"body":"Do you like pineapples?"}'

Response

Status: 200
{ "author": { "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 }, "body": "Do you like pineapples?", "body_html": "<p>Do you like pineapples?</p>", "body_version": "e6907b24d9c93cc0c5024a7af5888116", "created_at": "2018-01-15T23:53:58Z", "last_edited_at": "2018-01-26T18:22:20Z", "discussion_url": "https://api.github.com/teams/2403582/discussions/1", "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1", "node_id": "MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=", "number": 1, "updated_at": "2018-01-26T18:22:20Z", "url": "https://api.github.com/teams/2403582/discussions/1/comments/1", "reactions": { "url": "https://api.github.com/teams/2403582/discussions/1/reactions", "total_count": 5, "+1": 3, "-1": 1, "laugh": 0, "confused": 0, "heart": 1, "hooray": 0, "eyes": 1, "rocket": 1 } }

Aviso de previsualización

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Delete a discussion comment (Legacy)

Funciona con GitHub Apps

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Delete a discussion comment endpoint.

Deletes a comment on a team discussion. OAuth access tokens require the write:discussion scope.

Parámetros

Headers
Name, Type, Description
acceptstring

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

Path parameters
Name, Type, Description
team_idintegerRequired

The unique identifier of the team.

discussion_numberintegerRequired

The number that identifies the discussion.

comment_numberintegerRequired

The number that identifies the comment.

Códigos de estado de respuesta HTTP

status codeDescripción
204

No Content

Ejemplos de código

delete/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}
curl \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/teams/TEAM_ID/discussions/DISCUSSION_NUMBER/comments/COMMENT_NUMBER

Response

Status: 204