Puntos de conexión de la API de REST para comentarios de incidencias
Usa la API REST para administrar comentarios sobre problemas y solicitudes de incorporación de cambios.
Acerca de los comentarios de incidencias y las solicitudes de incorporación de cambios
Puedes usar la API REST para crear y administrar comentarios sobre problemas y solicitudes de incorporación de cambios. Cada solicitud de extracción es un informe de problemas, pero no todos los informes de problemas son una solicitud de extracción. Es por esto que las acciones "compartidas" para ambas características, como la administración de los asignados, las etiquetas y los hitos, se proporcionan dentro de los puntos de conexión de incidencias. Para administrar comentarios sobre revisiones de solicitudes de incorporación de cambios, consulta Puntos de conexión de la API de REST para comentarios de revisión de solicitudes de incorporación de cambios.
List issue comments for a repository
You can use the REST API to list comments on issues and pull requests for a repository. Every pull request is an issue, but not every issue is a pull request.
By default, issue comments are ordered by ascending ID.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github.raw+json: Returns the raw markdown body. Response will include- body. This is the default if you do not pass any specific media type.
- application/vnd.github.text+json: Returns a text only representation of the markdown body. Response will include- body_text.
- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include- body_html.
- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include- body,- body_text, and- body_html.
Tokens de acceso específicos para "List issue comments for a repository"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener al menos uno de los siguientes conjuntos de permisos:
- "Issues" repository permissions (read)
- "Pull requests" repository permissions (read)
Este punto de conexión se puede usar sin autenticación o los permisos mencionados anteriormente si solo se solicitan recursos públicos.
Parámetros para "List issue comments for a repository"
| Nombre, Tipo, Descripción | 
|---|
| acceptstringSetting to  | 
| Nombre, Tipo, Descripción | 
|---|
| ownerstring RequeridoThe account owner of the repository. The name is not case sensitive. | 
| repostring RequeridoThe name of the repository without the  | 
| Nombre, Tipo, Descripción | 
|---|
| sortstringThe property to sort the results by. Valor predeterminado:  Puede ser uno de los siguientes:  | 
| directionstringEither  Puede ser uno de los siguientes:  | 
| sincestringOnly show results that were last updated after the given time. This is a timestamp in ISO 8601 format:  | 
| per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." Valor predeterminado:  | 
| pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API." Valor predeterminado:  | 
Códigos de estado de respuesta HTTP para "List issue comments for a repository"
| status code | Descripción | 
|---|---|
| 200 | OK | 
| 404 | Resource not found | 
| 422 | Validation failed, or the endpoint has been spammed. | 
Ejemplos de código para "List issue comments for a repository"
Ejemplo de solicitud
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/commentsResponse
Status: 200[
  {
    "id": 1,
    "node_id": "MDEyOklzc3VlQ29tbWVudDE=",
    "url": "https://HOSTNAME/repos/octocat/Hello-World/issues/comments/1",
    "html_url": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1",
    "body": "Me too",
    "user": {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "",
      "url": "https://HOSTNAME/users/octocat",
      "html_url": "https://github.com/octocat",
      "followers_url": "https://HOSTNAME/users/octocat/followers",
      "following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
      "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
      "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
      "organizations_url": "https://HOSTNAME/users/octocat/orgs",
      "repos_url": "https://HOSTNAME/users/octocat/repos",
      "events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
      "received_events_url": "https://HOSTNAME/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    },
    "created_at": "2011-04-14T16:00:49Z",
    "updated_at": "2011-04-14T16:00:49Z",
    "issue_url": "https://HOSTNAME/repos/octocat/Hello-World/issues/1347",
    "author_association": "COLLABORATOR"
  }
]Get an issue comment
You can use the REST API to get comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github.raw+json: Returns the raw markdown body. Response will include- body. This is the default if you do not pass any specific media type.
- application/vnd.github.text+json: Returns a text only representation of the markdown body. Response will include- body_text.
- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include- body_html.
- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include- body,- body_text, and- body_html.
Tokens de acceso específicos para "Get an issue comment"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener al menos uno de los siguientes conjuntos de permisos:
- "Issues" repository permissions (read)
- "Pull requests" repository permissions (read)
Este punto de conexión se puede usar sin autenticación o los permisos mencionados anteriormente si solo se solicitan recursos públicos.
Parámetros para "Get an issue comment"
| Nombre, Tipo, Descripción | 
|---|
| acceptstringSetting to  | 
| Nombre, Tipo, Descripción | 
|---|
| ownerstring RequeridoThe account owner of the repository. The name is not case sensitive. | 
| repostring RequeridoThe name of the repository without the  | 
| comment_idinteger RequeridoThe unique identifier of the comment. | 
Códigos de estado de respuesta HTTP para "Get an issue comment"
| status code | Descripción | 
|---|---|
| 200 | OK | 
| 404 | Resource not found | 
Ejemplos de código para "Get an issue comment"
Ejemplo de solicitud
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/comments/COMMENT_IDResponse
Status: 200{
  "id": 1,
  "node_id": "MDEyOklzc3VlQ29tbWVudDE=",
  "url": "https://HOSTNAME/repos/octocat/Hello-World/issues/comments/1",
  "html_url": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1",
  "body": "Me too",
  "user": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://HOSTNAME/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://HOSTNAME/users/octocat/followers",
    "following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
    "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
    "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
    "organizations_url": "https://HOSTNAME/users/octocat/orgs",
    "repos_url": "https://HOSTNAME/users/octocat/repos",
    "events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
    "received_events_url": "https://HOSTNAME/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  },
  "created_at": "2011-04-14T16:00:49Z",
  "updated_at": "2011-04-14T16:00:49Z",
  "issue_url": "https://HOSTNAME/repos/octocat/Hello-World/issues/1347",
  "author_association": "COLLABORATOR"
}Update an issue comment
You can use the REST API to update comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github.raw+json: Returns the raw markdown body. Response will include- body. This is the default if you do not pass any specific media type.
- application/vnd.github.text+json: Returns a text only representation of the markdown body. Response will include- body_text.
- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include- body_html.
- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include- body,- body_text, and- body_html.
Tokens de acceso específicos para "Update an issue comment"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener al menos uno de los siguientes conjuntos de permisos:
- "Issues" repository permissions (write)
- "Pull requests" repository permissions (write)
Parámetros para "Update an issue comment"
| Nombre, Tipo, Descripción | 
|---|
| acceptstringSetting to  | 
| Nombre, Tipo, Descripción | 
|---|
| ownerstring RequeridoThe account owner of the repository. The name is not case sensitive. | 
| repostring RequeridoThe name of the repository without the  | 
| comment_idinteger RequeridoThe unique identifier of the comment. | 
| Nombre, Tipo, Descripción | 
|---|
| bodystring RequeridoThe contents of the comment. | 
Códigos de estado de respuesta HTTP para "Update an issue comment"
| status code | Descripción | 
|---|---|
| 200 | OK | 
| 422 | Validation failed, or the endpoint has been spammed. | 
Ejemplos de código para "Update an issue comment"
Ejemplo de solicitud
curl -L \
  -X PATCH \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/comments/COMMENT_ID \
  -d '{"body":"Me too"}'Response
Status: 200{
  "id": 1,
  "node_id": "MDEyOklzc3VlQ29tbWVudDE=",
  "url": "https://HOSTNAME/repos/octocat/Hello-World/issues/comments/1",
  "html_url": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1",
  "body": "Me too",
  "user": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://HOSTNAME/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://HOSTNAME/users/octocat/followers",
    "following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
    "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
    "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
    "organizations_url": "https://HOSTNAME/users/octocat/orgs",
    "repos_url": "https://HOSTNAME/users/octocat/repos",
    "events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
    "received_events_url": "https://HOSTNAME/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  },
  "created_at": "2011-04-14T16:00:49Z",
  "updated_at": "2011-04-14T16:00:49Z",
  "issue_url": "https://HOSTNAME/repos/octocat/Hello-World/issues/1347",
  "author_association": "COLLABORATOR"
}Delete an issue comment
You can use the REST API to delete comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.
Tokens de acceso específicos para "Delete an issue comment"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener al menos uno de los siguientes conjuntos de permisos:
- "Issues" repository permissions (write)
- "Pull requests" repository permissions (write)
Parámetros para "Delete an issue comment"
| Nombre, Tipo, Descripción | 
|---|
| acceptstringSetting to  | 
| Nombre, Tipo, Descripción | 
|---|
| ownerstring RequeridoThe account owner of the repository. The name is not case sensitive. | 
| repostring RequeridoThe name of the repository without the  | 
| comment_idinteger RequeridoThe unique identifier of the comment. | 
Códigos de estado de respuesta HTTP para "Delete an issue comment"
| status code | Descripción | 
|---|---|
| 204 | No Content | 
Ejemplos de código para "Delete an issue comment"
Ejemplo de solicitud
curl -L \
  -X DELETE \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/comments/COMMENT_IDResponse
Status: 204List issue comments
You can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.
Issue comments are ordered by ascending ID.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github.raw+json: Returns the raw markdown body. Response will include- body. This is the default if you do not pass any specific media type.
- application/vnd.github.text+json: Returns a text only representation of the markdown body. Response will include- body_text.
- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include- body_html.
- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include- body,- body_text, and- body_html.
Tokens de acceso específicos para "List issue comments"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener al menos uno de los siguientes conjuntos de permisos:
- "Issues" repository permissions (read)
- "Pull requests" repository permissions (read)
Este punto de conexión se puede usar sin autenticación o los permisos mencionados anteriormente si solo se solicitan recursos públicos.
Parámetros para "List issue comments"
| Nombre, Tipo, Descripción | 
|---|
| acceptstringSetting to  | 
| Nombre, Tipo, Descripción | 
|---|
| ownerstring RequeridoThe account owner of the repository. The name is not case sensitive. | 
| repostring RequeridoThe name of the repository without the  | 
| issue_numberinteger RequeridoThe number that identifies the issue. | 
| Nombre, Tipo, Descripción | 
|---|
| sincestringOnly show results that were last updated after the given time. This is a timestamp in ISO 8601 format:  | 
| per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." Valor predeterminado:  | 
| pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API." Valor predeterminado:  | 
Códigos de estado de respuesta HTTP para "List issue comments"
| status code | Descripción | 
|---|---|
| 200 | OK | 
| 404 | Resource not found | 
| 410 | Gone | 
Ejemplos de código para "List issue comments"
Ejemplo de solicitud
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/ISSUE_NUMBER/commentsResponse
Status: 200[
  {
    "id": 1,
    "node_id": "MDEyOklzc3VlQ29tbWVudDE=",
    "url": "https://HOSTNAME/repos/octocat/Hello-World/issues/comments/1",
    "html_url": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1",
    "body": "Me too",
    "user": {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "",
      "url": "https://HOSTNAME/users/octocat",
      "html_url": "https://github.com/octocat",
      "followers_url": "https://HOSTNAME/users/octocat/followers",
      "following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
      "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
      "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
      "organizations_url": "https://HOSTNAME/users/octocat/orgs",
      "repos_url": "https://HOSTNAME/users/octocat/repos",
      "events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
      "received_events_url": "https://HOSTNAME/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    },
    "created_at": "2011-04-14T16:00:49Z",
    "updated_at": "2011-04-14T16:00:49Z",
    "issue_url": "https://HOSTNAME/repos/octocat/Hello-World/issues/1347",
    "author_association": "COLLABORATOR"
  }
]Create an issue comment
You can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "Rate limits for the API" and "Best practices for using the REST API."
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github.raw+json: Returns the raw markdown body. Response will include- body. This is the default if you do not pass any specific media type.
- application/vnd.github.text+json: Returns a text only representation of the markdown body. Response will include- body_text.
- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include- body_html.
- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include- body,- body_text, and- body_html.
Tokens de acceso específicos para "Create an issue comment"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener al menos uno de los siguientes conjuntos de permisos:
- "Issues" repository permissions (write)
- "Pull requests" repository permissions (write)
Parámetros para "Create an issue comment"
| Nombre, Tipo, Descripción | 
|---|
| acceptstringSetting to  | 
| Nombre, Tipo, Descripción | 
|---|
| ownerstring RequeridoThe account owner of the repository. The name is not case sensitive. | 
| repostring RequeridoThe name of the repository without the  | 
| issue_numberinteger RequeridoThe number that identifies the issue. | 
| Nombre, Tipo, Descripción | 
|---|
| bodystring RequeridoThe contents of the comment. | 
Códigos de estado de respuesta HTTP para "Create an issue comment"
| status code | Descripción | 
|---|---|
| 201 | Created | 
| 403 | Forbidden | 
| 404 | Resource not found | 
| 410 | Gone | 
| 422 | Validation failed, or the endpoint has been spammed. | 
Ejemplos de código para "Create an issue comment"
Ejemplo de solicitud
curl -L \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/ISSUE_NUMBER/comments \
  -d '{"body":"Me too"}'Response
Status: 201{
  "id": 1,
  "node_id": "MDEyOklzc3VlQ29tbWVudDE=",
  "url": "https://HOSTNAME/repos/octocat/Hello-World/issues/comments/1",
  "html_url": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1",
  "body": "Me too",
  "user": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://HOSTNAME/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://HOSTNAME/users/octocat/followers",
    "following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
    "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
    "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
    "organizations_url": "https://HOSTNAME/users/octocat/orgs",
    "repos_url": "https://HOSTNAME/users/octocat/repos",
    "events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
    "received_events_url": "https://HOSTNAME/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  },
  "created_at": "2011-04-14T16:00:49Z",
  "updated_at": "2011-04-14T16:00:49Z",
  "issue_url": "https://HOSTNAME/repos/octocat/Hello-World/issues/1347",
  "author_association": "COLLABORATOR"
}