Query fork repository synchronization status¶
GET /api/v5/repos/{owner}/{repo}/sync_repo
Call this endpoint to query the synchronization status of a fork repository.
Access token support¶
- AtomGit user access tokens
Anonymous access¶
This endpoint does not allow anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
owner |
path | string | Yes | Address of the namespace that owns the repository (the address path of the enterprise, organization, or personal namespace) |
repo |
path | string | Yes | Repository path (path) |
access_token |
query | string | Yes | User authorization code |
branch |
query | string | No | Branch name |
Response parameters¶
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
repo_sync_result |
boolean | Yes | No | Whether the fork repository was synchronized successfully |
repo_sync_message |
string | Yes | No | Fork repository synchronization status message |
Error response¶
400 Invalid parameters
{
"error": "invalid_request",
"message": "Invalid parameters, or the request cannot be parsed",
"field": "branch"
}
401 Unauthenticated
HTTP response status codes¶
| Status code | Description |
|---|---|
200 |
Succeeded (OK) |
401 |
Authentication required (Requires authentication) |
Request example¶
Parameter notes¶
Replace
<owner>with the address of the namespace that owns the repository (the address path of the enterprise, organization, or personal namespace); replace<repo>with the repository path (path); replace<token>with your AtomGit user access token; replace<branch>with the branch name.
cURL¶
curl -X GET 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/sync_repo?access_token=<token>&branch=<branch>' \
-H 'Accept: application/json'
JavaScript¶
// Native fetch (Node.js 18+ / browser)
const owner = "<owner>";
const repo = "<repo>";
const token = "<token>";
const branch = "<branch>";
const response = await fetch(
`https://api.atomgit.com/api/v5/repos/${owner}/${repo}/sync_repo?access_token=${token}&branch=${branch}`,
{
headers: {
"Accept": "application/json",
},
}
);
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const data = await response.json();
console.log(data);
Python¶
import requests
resp = requests.get(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/sync_repo",
params={
"access_token": "<token>",
"branch": "<branch>",
},
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) |
403 |
Access forbidden (Forbidden) |
404 |
The request path does not exist |
429 |
Too many requests; rate limit triggered |
500 |
Internal system error |
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc