Skip to main content
Skip to content
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_url key provided in the response.
  • Alternatively, set the Accept header of the request to application/octet-stream. The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a 200 or 302 response.

"Get a release asset" のきめ細かいアクセス トークン

このエンドポイントは、次の粒度の細かいトークンの種類で動作します:

粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:

  • "Contents" repository permissions (read)

このエンドポイントは、パブリック リソースのみが要求される場合は、認証または前述メンションアクセス許可なしで使用できます。

"Get a release asset" のパラメーター

ヘッダー
名前, タイプ, 説明
accept string

Setting to application/vnd.github+json is recommended.

パスパラメーター
名前, タイプ, 説明
owner string 必須

The account owner of the repository. The name is not case sensitive.

repo string 必須

The name of the repository without the .git extension. The name is not case sensitive.

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にアクセスする場合は、