Skip to main content
설명서에 자주 업데이트를 게시하며 이 페이지의 번역이 계속 진행 중일 수 있습니다. 최신 정보는 영어 설명서를 참조하세요.

We've recently moved some of the REST API documentation. If you can't find what you're looking for, you might try the new Branches, Collaborators, Commits, Deploy Keys, Deployments, GitHub Pages, Releases, Metrics, Webhooks REST API pages.

리포지토리 자동 링크

REST API를 사용하여 외부 리소스에 자동 링크를 추가합니다.

워크플로를 간소화하기 위해 REST API를 사용하여 JIRA 문제 및 Zendesk 티켓과 같은 외부 리소스에 자동 링크를 추가할 수 있습니다. 자세한 내용은 “외부 리소스를 참조하도록 자동 링크 구성”을 참조하세요.

GitHub Apps에는 이러한 엔드포인트를 사용하려면 읽기 또는 쓰기 권한이 있는 리포지토리 관리 권한이 필요합니다.

에서 작동 GitHub Apps

This returns a list of autolinks configured for the given repository.

Information about autolinks are only available to repository administrators.

헤더
이름, Type, 설명
acceptstring

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

경로 매개 변수
이름, Type, 설명
ownerstring필수

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

repostring필수

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

쿼리 매개 변수
이름, Type, 설명
pageinteger

Page number of the results to fetch.

기본값: 1

상태 코드Description
200

OK

get/repos/{owner}/{repo}/autolinks
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/autolinks

Response

Status: 200
[ { "id": 1, "key_prefix": "TICKET-", "url_template": "https://example.com/TICKET?query=<num>" } ]
에서 작동 GitHub Apps

Users with admin access to the repository can create an autolink.

헤더
이름, Type, 설명
acceptstring

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

경로 매개 변수
이름, Type, 설명
ownerstring필수

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

repostring필수

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

본문 매개 변수
이름, Type, 설명
key_prefixstring필수

The prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit.

url_templatestring필수

The URL must contain <num> for the reference number.

is_alphanumericboolean

Whether this autolink reference matches alphanumeric characters. If true, the <num> parameter of the url_template matches alphanumeric characters A-Z (case insensitive), 0-9, and -. If false, this autolink reference only matches numeric characters.

기본값: true

상태 코드Description
201

Created

422

Validation failed, or the endpoint has been spammed.

post/repos/{owner}/{repo}/autolinks
curl \ -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

Status: 201
{ "id": 1, "key_prefix": "TICKET-", "url_template": "https://example.com/TICKET?query=<num>" }
에서 작동 GitHub Apps

This returns a single autolink reference by ID that was configured for the given repository.

Information about autolinks are only available to repository administrators.

헤더
이름, Type, 설명
acceptstring

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

경로 매개 변수
이름, Type, 설명
ownerstring필수

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

repostring필수

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

autolink_idinteger필수

The unique identifier of the autolink.

상태 코드Description
200

OK

404

Resource not found

get/repos/{owner}/{repo}/autolinks/{autolink_id}
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/autolinks/AUTOLINK_ID

Response

Status: 200
{ "id": 1, "key_prefix": "TICKET-", "url_template": "https://example.com/TICKET?query=<num>" }
에서 작동 GitHub Apps

This deletes a single autolink reference by ID that was configured for the given repository.

Information about autolinks are only available to repository administrators.

헤더
이름, Type, 설명
acceptstring

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

경로 매개 변수
이름, Type, 설명
ownerstring필수

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

repostring필수

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

autolink_idinteger필수

The unique identifier of the autolink.

상태 코드Description
204

No Content

404

Resource not found

delete/repos/{owner}/{repo}/autolinks/{autolink_id}
curl \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/autolinks/AUTOLINK_ID

Response

Status: 204