Handle pull request review¶
POST /api/v5/repos/{owner}/{repo}/pulls/{number}/review
This endpoint handles the review of the pull request with the specified number in the specified repository. Submitting a review request advances the review workflow of the pull request, and forcing the review to pass is supported; this forced operation is only available to administrators.
Supported access tokens¶
- AtomGit user access token (AtomGit user access tokens)
Anonymous access¶
This endpoint does not allow anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
owner |
path | string | Yes | Namespace address of the repository (the address path of an organization or user) |
repo |
path | string | Yes | Repository path (path) |
number |
path | integer | Yes | Ordinal number of the pull request in this repository |
access_token |
query | string | Yes | User authorization code |
Request Body:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"force": {
"description": "Whether to force the review to pass (default: no); only available to administrators",
"type": "boolean",
"default": false
}
},
"required": []
}
Response parameters¶
A successful response is an empty JSON object {} and returns no business fields.
Error response¶
400 Invalid parameters
401 Unauthenticated
Note: The error field names above are as actually returned by the backend; they are examples only.
HTTP response status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
400 |
Bad request |
401 |
Requires authentication |
403 |
Forbidden |
404 |
Not found |
429 |
Too many requests; the rate limit is triggered |
500 |
Internal system error |
Request example¶
Parameter description¶
In the following example, replace <owner> with the namespace address of the repository (the address path of an enterprise, organization, or user), <repo> with the repository path (path), <number> with the ordinal number of the pull request in this repository, and <token> with your AtomGit user access token.
cURL¶
curl -X POST 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/review?access_token=<token>' \
-H 'Content-Type: application/json' \
-d '{"force": false}'
JavaScript¶
// Native fetch (Node.js 18+ / browsers)
const response = await fetch("https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/review?access_token=<token>", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
},
body: JSON.stringify({ force: false }),
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const data = await response.json();
console.log(data);
Python¶
import requests
resp = requests.post(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/review",
params={"access_token": "<token>"},
json={"force": False},
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing or invalid access credentials) |
400 |
Invalid parameters or the request cannot be parsed |
403 |
Forbidden |
404 |
The request path does not exist |
429 |
Too many requests; the rate limit is triggered |
500 |
Internal system error |
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc