このバージョンの GitHub Enterprise サーバーはこの日付をもって終了となりました: 2024-03-26. 重大なセキュリティの問題に対してであっても、パッチリリースは作成されません。 パフォーマンスの向上、セキュリティの向上、新機能の向上を図るために、最新バージョンの GitHub Enterprise サーバーにアップグレードしてください。 アップグレードに関するヘルプについては、GitHub Enterprise サポートにお問い合わせください。
リポジトリ自動リンク用の REST API エンドポイント
REST API を使って、外部リソースへの自動リンクを追加します。
リポジトリの自動リンクについて
ワークフローを効率化するため、REST API を使って、JIRA のイシューや Zendesk のチケットなどの外部リソースへの自動リンクを追加できます。 詳しくは、「外部リソースを参照する自動リンクの構成」を参照してください。
これらのエンドポイントを使うには、読み取りまたは書き込みアクセス権を持つリポジトリ管理アクセス許可が GitHub Apps に必要です。
Get all autolinks of a repository
Gets all autolinks that are configured for a repository.
Information about autolinks are only available to repository administrators.
"Get all autolinks of a repository" のパラメーター
| 名前, Type, 説明 | 
|---|
accept string Setting to   | 
| 名前, Type, 説明 | 
|---|
owner string 必須The account owner of the repository. The name is not case sensitive.  | 
repo string 必須The name of the repository without the   | 
"Get all autolinks of a repository" の HTTP 応答状態コード
| 状態コード | 説明 | 
|---|---|
200 | OK  | 
"Get all autolinks of a repository" のコード サンプル
要求の例
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/autolinksResponse
Create an autolink reference for a repository
Users with admin access to the repository can create an autolink.
"Create an autolink reference for a repository" のパラメーター
| 名前, Type, 説明 | 
|---|
accept string Setting to   | 
| 名前, Type, 説明 | 
|---|
owner string 必須The account owner of the repository. The name is not case sensitive.  | 
repo string 必須The name of the repository without the   | 
| 名前, Type, 説明 | 
|---|
key_prefix string 必須This prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit.  | 
url_template string 必須The URL must contain   | 
is_alphanumeric boolean Whether this autolink reference matches alphanumeric characters. If true, the  Default:   | 
"Create an autolink reference for a repository" の HTTP 応答状態コード
| 状態コード | 説明 | 
|---|---|
201 | Created  | 
422 | Validation failed, or the endpoint has been spammed.  | 
"Create an autolink reference for a repository" のコード サンプル
要求の例
curl -L \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/autolinks \
  -d '{"key_prefix":"TICKET-","url_template":"https://example.com/TICKET?query=<num>","is_alphanumeric":true}'response
Get an autolink reference of a repository
This returns a single autolink reference by ID that was configured for the given repository.
Information about autolinks are only available to repository administrators.
"Get an autolink reference of a repository" のパラメーター
| 名前, Type, 説明 | 
|---|
accept string Setting to   | 
| 名前, Type, 説明 | 
|---|
owner string 必須The account owner of the repository. The name is not case sensitive.  | 
repo string 必須The name of the repository without the   | 
autolink_id integer 必須The unique identifier of the autolink.  | 
"Get an autolink reference of a repository" の HTTP 応答状態コード
| 状態コード | 説明 | 
|---|---|
200 | OK  | 
404 | Resource not found  | 
"Get an autolink reference of a repository" のコード サンプル
要求の例
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/autolinks/AUTOLINK_IDResponse
Delete an autolink reference from a repository
This deletes a single autolink reference by ID that was configured for the given repository.
Information about autolinks are only available to repository administrators.
"Delete an autolink reference from a repository" のパラメーター
| 名前, Type, 説明 | 
|---|
accept string Setting to   | 
| 名前, Type, 説明 | 
|---|
owner string 必須The account owner of the repository. The name is not case sensitive.  | 
repo string 必須The name of the repository without the   | 
autolink_id integer 必須The unique identifier of the autolink.  | 
"Delete an autolink reference from a repository" の HTTP 応答状態コード
| 状態コード | 説明 | 
|---|---|
204 | No Content  | 
404 | Resource not found  | 
"Delete an autolink reference from a repository" のコード サンプル
要求の例
curl -L \
  -X DELETE \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/autolinks/AUTOLINK_IDResponse
Status: 204