Download a repository release attachment¶
GET /api/v5/repos/{owner}/{repo}/releases/{tag}/attach_files/{file_name}/download
Call this endpoint to download a repository release attachment.
Access token support¶
- AtomGit user access tokens
Anonymous access¶
This endpoint allows anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
owner |
path | string | Yes | Namespace address that owns the repository (enterprise, organization, or personal address path) |
repo |
path | string | Yes | Repository path (path) |
tag |
path | string | Yes | Tag name |
file_name |
path | string | Yes | Attachment name |
Response parameters¶
On success, the binary content of the attachment file (file stream) is returned directly; there are no structured response fields.
Error response¶
Error responses from this endpoint follow the platform's unified error format; the actual error field names are determined by the backend response. Possible failure scenarios include:
401 Unauthenticated
Returned when the supplied access token is invalid or missing.
404 Resource does not exist
Returned when the release or attachment does not exist.
HTTP status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
401 |
Requires authentication |
404 |
Not found |
429 |
Too many requests; rate limit triggered |
500 |
Internal server error |
Request example¶
Parameter details¶
This endpoint allows anonymous access and requires no access token. To access it as a user, you can include the access_token query parameter.
Replace
<owner>with the namespace address that owns the repository (enterprise, organization, or personal address path); replace<repo>with the repository path (path); replace<tag>with the release tag name; replace<file_name>with the attachment name.
cURL¶
curl -L -X GET 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/releases/<tag>/attach_files/<file_name>/download'
JavaScript¶
// Native fetch (Node.js 18+ / browser)
const response = await fetch("https://api.atomgit.com/api/v5/repos/<owner>/<repo>/releases/<tag>/attach_files/<file_name>/download", {
headers: {
"Accept": "*/*",
},
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const blob = await response.blob();
console.log(blob);
Python¶
import requests
resp = requests.get(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/releases/<tag>/attach_files/<file_name>/download",
timeout=10,
)
resp.raise_for_status()
print(resp.content)
Response example¶
Status code: 200
On success, the binary content of the attachment file is returned (the response body is a file stream with no structured fields).
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing or invalid access token) |
404 |
Not found (the release or attachment does not exist) |
429 |
Too many requests; rate limit triggered |
500 |
Internal server error |
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc