REST API はバージョン化されました。 詳細については、「API のバージョン管理について」を参照してください。
リリース アセット用 REST API エンドポイント
REST API を使って、リリース アセットを管理します。
Get a release asset
To download the asset's binary content:
- If within a browser, fetch the location specified in the
browser_download_urlkey provided in the response. - Alternatively, set the
Acceptheader of the request toapplication/octet-stream. The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a200or302response.
"Get a release asset" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Contents" repository permissions (read)
このエンドポイントは、パブリック リソースのみが要求される場合は、認証または前述メンションアクセス許可なしで使用できます。
"Get a release asset" のパラメーター
| 名前, タイプ, 説明 |
|---|
accept string Setting to |
| 名前, タイプ, 説明 |
|---|
owner string 必須The account owner of the repository. The name is not case sensitive. |
repo string 必須The name of the repository without the |
asset_id integer 必須The unique identifier of the asset. |
"Get a release asset" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
200 | OK |
302 | Found |
404 | Resource not found |
"Get a release asset" のコード サンプル
GHE.com でGitHubにアクセスする場合は、