Puntos de conexión de la API de REST para comentarios de revisión de solicitudes de incorporación de cambios
Usa la API REST para interactuar con los comentarios de revisión de solicitudes de incorporación de cambios.
Acerca de los comentarios de revisión de solicitudes de incorporación de cambios
Los comentarios de revisión de las solicitudes de incorporación de cambios son comentarios realizados en una parte de la diferencia unificada durante la revisión de una solicitud de incorporación de cambios. Estos son diferentes de los comentarios de confirmación y los comentarios de incidencias en una solicitud de incorporación de cambios. Para más información, consulta Puntos de conexión de la API de REST para comentarios de confirmaciones y Puntos de conexión de la API de REST para comentarios de incidencias.
List review comments in a repository
Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github-commitcomment.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-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include- body_text.
- application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include- body_html.
- application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include- body,- body_text, and- body_html.
Tokens de acceso específicos para "List review comments in 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 el siguiente conjunto de permisos:
- "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 review comments in 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 | 
|---|
| sortstringPuede ser uno de los siguientes:  | 
| directionstringThe direction to sort results. Ignored without  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 review comments in a repository"
| status code | Descripción | 
|---|---|
| 200 | OK | 
Ejemplos de código para "List review comments in 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/pulls/commentsResponse
Status: 200[
  {
    "url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1",
    "pull_request_review_id": 42,
    "id": 10,
    "node_id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw",
    "diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
    "path": "file1.txt",
    "position": 1,
    "original_position": 4,
    "commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
    "original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
    "in_reply_to_id": 8,
    "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
    },
    "body": "Great stuff!",
    "created_at": "2011-04-14T16:00:49Z",
    "updated_at": "2011-04-14T16:00:49Z",
    "html_url": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1",
    "pull_request_url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1",
    "author_association": "NONE",
    "_links": {
      "self": {
        "href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1"
      },
      "html": {
        "href": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1"
      },
      "pull_request": {
        "href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1"
      }
    },
    "start_line": 1,
    "original_start_line": 1,
    "start_side": "RIGHT",
    "line": 2,
    "original_line": 2,
    "side": "RIGHT"
  }
]Get a review comment for a pull request
Provides details for a specified review comment.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github-commitcomment.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-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include- body_text.
- application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include- body_html.
- application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include- body,- body_text, and- body_html.
Tokens de acceso específicos para "Get a review comment for a pull request"
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 el siguiente conjunto de permisos:
- "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 a review comment for a pull request"
| 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 a review comment for a pull request"
| status code | Descripción | 
|---|---|
| 200 | OK | 
| 404 | Resource not found | 
Ejemplos de código para "Get a review comment for a pull request"
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/pulls/comments/COMMENT_IDResponse
Status: 200{
  "url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1",
  "pull_request_review_id": 42,
  "id": 10,
  "node_id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw",
  "diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
  "path": "file1.txt",
  "position": 1,
  "original_position": 4,
  "commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
  "original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
  "in_reply_to_id": 8,
  "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
  },
  "body": "Great stuff!",
  "created_at": "2011-04-14T16:00:49Z",
  "updated_at": "2011-04-14T16:00:49Z",
  "html_url": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1",
  "pull_request_url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1",
  "author_association": "NONE",
  "_links": {
    "self": {
      "href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1"
    },
    "html": {
      "href": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1"
    },
    "pull_request": {
      "href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1"
    }
  },
  "start_line": 1,
  "original_start_line": 1,
  "start_side": "RIGHT",
  "line": 2,
  "original_line": 2,
  "side": "RIGHT"
}Update a review comment for a pull request
Edits the content of a specified review comment.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github-commitcomment.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-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include- body_text.
- application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include- body_html.
- application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include- body,- body_text, and- body_html.
Tokens de acceso específicos para "Update a review comment for a pull request"
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 el siguiente conjunto de permisos:
- "Pull requests" repository permissions (write)
Parámetros para "Update a review comment for a pull request"
| 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 text of the reply to the review comment. | 
Códigos de estado de respuesta HTTP para "Update a review comment for a pull request"
| status code | Descripción | 
|---|---|
| 200 | OK | 
Ejemplos de código para "Update a review comment for a pull request"
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/pulls/comments/COMMENT_ID \
  -d '{"body":"I like this too!"}'Response
Status: 200{
  "url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1",
  "pull_request_review_id": 42,
  "id": 10,
  "node_id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw",
  "diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
  "path": "file1.txt",
  "position": 1,
  "original_position": 4,
  "commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
  "original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
  "in_reply_to_id": 8,
  "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
  },
  "body": "Great stuff!",
  "created_at": "2011-04-14T16:00:49Z",
  "updated_at": "2011-04-14T16:00:49Z",
  "html_url": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1",
  "pull_request_url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1",
  "author_association": "NONE",
  "_links": {
    "self": {
      "href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1"
    },
    "html": {
      "href": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1"
    },
    "pull_request": {
      "href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1"
    }
  },
  "start_line": 1,
  "original_start_line": 1,
  "start_side": "RIGHT",
  "line": 2,
  "original_line": 2,
  "side": "RIGHT"
}Delete a review comment for a pull request
Deletes a review comment.
Tokens de acceso específicos para "Delete a review comment for a pull request"
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 el siguiente conjunto de permisos:
- "Pull requests" repository permissions (write)
Parámetros para "Delete a review comment for a pull request"
| 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 a review comment for a pull request"
| status code | Descripción | 
|---|---|
| 204 | No Content | 
| 404 | Resource not found | 
Ejemplos de código para "Delete a review comment for a pull request"
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/pulls/comments/COMMENT_IDResponse
Status: 204List review comments on a pull request
Lists all review comments for a specified pull request. By default, review comments are in ascending order by ID.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github-commitcomment.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-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include- body_text.
- application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include- body_html.
- application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include- body,- body_text, and- body_html.
Tokens de acceso específicos para "List review comments on a pull request"
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 el siguiente conjunto de permisos:
- "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 review comments on a pull request"
| 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  | 
| pull_numberinteger RequeridoThe number that identifies the pull request. | 
| Nombre, Tipo, Descripción | 
|---|
| sortstringThe property to sort the results by. Valor predeterminado:  Puede ser uno de los siguientes:  | 
| directionstringThe direction to sort results. Ignored without  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 review comments on a pull request"
| status code | Descripción | 
|---|---|
| 200 | OK | 
Ejemplos de código para "List review comments on a pull request"
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/pulls/PULL_NUMBER/commentsResponse
Status: 200[
  {
    "url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1",
    "pull_request_review_id": 42,
    "id": 10,
    "node_id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw",
    "diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
    "path": "file1.txt",
    "position": 1,
    "original_position": 4,
    "commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
    "original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
    "in_reply_to_id": 8,
    "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
    },
    "body": "Great stuff!",
    "created_at": "2011-04-14T16:00:49Z",
    "updated_at": "2011-04-14T16:00:49Z",
    "html_url": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1",
    "pull_request_url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1",
    "author_association": "NONE",
    "_links": {
      "self": {
        "href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1"
      },
      "html": {
        "href": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1"
      },
      "pull_request": {
        "href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1"
      }
    },
    "start_line": 1,
    "original_start_line": 1,
    "start_side": "RIGHT",
    "line": 2,
    "original_line": 2,
    "side": "RIGHT"
  }
]Create a review comment for a pull request
Creates a review comment on the diff of a specified pull request. To add a regular comment to a pull request timeline, see "Create an issue comment."
If your comment applies to more than one line in the pull request diff, you should use the parameters line, side, and optionally start_line and start_side in your request.
The position parameter is closing down. If you use position, the line, side, start_line, and start_side parameters are not required.
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-commitcomment.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-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include- body_text.
- application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include- body_html.
- application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include- body,- body_text, and- body_html.
Tokens de acceso específicos para "Create a review comment for a pull request"
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 el siguiente conjunto de permisos:
- "Pull requests" repository permissions (write)
Parámetros para "Create a review comment for a pull request"
| 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  | 
| pull_numberinteger RequeridoThe number that identifies the pull request. | 
| Nombre, Tipo, Descripción | 
|---|
| bodystring RequeridoThe text of the review comment. | 
| commit_idstring RequeridoThe SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the  | 
| pathstring RequeridoThe relative path to the file that necessitates a comment. | 
| positionintegerThis parameter is closing down. Use  | 
| sidestringIn a split diff view, the side of the diff that the pull request's changes appear on. Can be  Puede ser uno de los siguientes:  | 
| lineintegerRequired unless using  | 
| start_lineintegerRequired when using multi-line comments unless using  | 
| start_sidestringRequired when using multi-line comments unless using  Puede ser uno de los siguientes:  | 
| in_reply_tointegerThe ID of the review comment to reply to. To find the ID of a review comment with "List review comments on a pull request". When specified, all parameters other than  | 
| subject_typestringThe level at which the comment is targeted. Puede ser uno de los siguientes:  | 
Códigos de estado de respuesta HTTP para "Create a review comment for a pull request"
| status code | Descripción | 
|---|---|
| 201 | Created | 
| 403 | Forbidden | 
| 422 | Validation failed, or the endpoint has been spammed. | 
Ejemplos de código para "Create a review comment for a pull request"
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/pulls/PULL_NUMBER/comments \
  -d '{"body":"Great stuff!","commit_id":"6dcb09b5b57875f334f61aebed695e2e4193db5e","path":"file1.txt","start_line":1,"start_side":"RIGHT","line":2,"side":"RIGHT"}'Response
Status: 201{
  "url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1",
  "pull_request_review_id": 42,
  "id": 10,
  "node_id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw",
  "diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
  "path": "file1.txt",
  "position": 1,
  "original_position": 4,
  "commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
  "original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
  "in_reply_to_id": 8,
  "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
  },
  "body": "Great stuff!",
  "created_at": "2011-04-14T16:00:49Z",
  "updated_at": "2011-04-14T16:00:49Z",
  "html_url": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1",
  "pull_request_url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1",
  "author_association": "NONE",
  "_links": {
    "self": {
      "href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1"
    },
    "html": {
      "href": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1"
    },
    "pull_request": {
      "href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1"
    }
  },
  "start_line": 1,
  "original_start_line": 1,
  "start_side": "RIGHT",
  "line": 2,
  "original_line": 2,
  "side": "RIGHT"
}Create a reply for a review comment
Creates a reply to a review comment for a pull request. For the comment_id, provide the ID of the review comment you are replying to. This must be the ID of a top-level review comment, not a reply to that comment. Replies to replies are not supported.
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-commitcomment.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-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include- body_text.
- application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include- body_html.
- application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include- body,- body_text, and- body_html.
Tokens de acceso específicos para "Create a reply for a review 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 el siguiente conjunto de permisos:
- "Pull requests" repository permissions (write)
Parámetros para "Create a reply for a review 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  | 
| pull_numberinteger RequeridoThe number that identifies the pull request. | 
| comment_idinteger RequeridoThe unique identifier of the comment. | 
| Nombre, Tipo, Descripción | 
|---|
| bodystring RequeridoThe text of the review comment. | 
Códigos de estado de respuesta HTTP para "Create a reply for a review comment"
| status code | Descripción | 
|---|---|
| 201 | Created | 
| 404 | Resource not found | 
Ejemplos de código para "Create a reply for a review 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/pulls/PULL_NUMBER/comments/COMMENT_ID/replies \
  -d '{"body":"Great stuff!"}'Response
Status: 201{
  "url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1",
  "pull_request_review_id": 42,
  "id": 10,
  "node_id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw",
  "diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
  "path": "file1.txt",
  "position": 1,
  "original_position": 4,
  "commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
  "original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
  "in_reply_to_id": 426899381,
  "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
  },
  "body": "Great stuff!",
  "created_at": "2011-04-14T16:00:49Z",
  "updated_at": "2011-04-14T16:00:49Z",
  "html_url": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1",
  "pull_request_url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1",
  "author_association": "NONE",
  "_links": {
    "self": {
      "href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1"
    },
    "html": {
      "href": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1"
    },
    "pull_request": {
      "href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1"
    }
  },
  "start_line": 1,
  "original_start_line": 1,
  "start_side": "RIGHT",
  "line": 2,
  "original_line": 2,
  "side": "RIGHT"
}