리포지토리 자동 링크에 대한 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"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Administration" repository permissions (read)
"Get all autolinks of a repository"에 대한 매개 변수
| 속성, 형식, 설명 | 
|---|
| acceptstringSetting to  | 
| 속성, 형식, 설명 | 
|---|
| ownerstring RequiredThe account owner of the repository. The name is not case sensitive. | 
| repostring RequiredThe name of the repository without the  | 
"Get all autolinks of a repository"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 | 
|---|---|
| 200 | OK | 
"Get all autolinks of a repository"에 대한 코드 샘플
GHE.com에서 GitHub에 액세스하는 경우 api.github.com을 api.SUBDOMAIN.ghe.com의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/OWNER/REPO/autolinksResponse
Status: 200[
  {
    "id": 1,
    "key_prefix": "TICKET-",
    "url_template": "https://example.com/TICKET?query=<num>",
    "is_alphanumeric": true
  }
]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"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Administration" repository permissions (write)
"Create an autolink reference for a repository"에 대한 매개 변수
| 속성, 형식, 설명 | 
|---|
| acceptstringSetting to  | 
| 속성, 형식, 설명 | 
|---|
| ownerstring RequiredThe account owner of the repository. The name is not case sensitive. | 
| repostring RequiredThe name of the repository without the  | 
| 속성, 형식, 설명 | 
|---|
| key_prefixstring RequiredThis prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit. | 
| url_templatestring RequiredThe URL must contain  | 
| is_alphanumericbooleanWhether this autolink reference matches alphanumeric characters. If true, the  기본값:  | 
"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"에 대한 코드 샘플
GHE.com에서 GitHub에 액세스하는 경우 api.github.com을 api.SUBDOMAIN.ghe.com의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/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>",
  "is_alphanumeric": true
}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"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Administration" repository permissions (read)
"Get an autolink reference of a repository"에 대한 매개 변수
| 속성, 형식, 설명 | 
|---|
| acceptstringSetting to  | 
| 속성, 형식, 설명 | 
|---|
| ownerstring RequiredThe account owner of the repository. The name is not case sensitive. | 
| repostring RequiredThe name of the repository without the  | 
| autolink_idinteger RequiredThe 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"에 대한 코드 샘플
GHE.com에서 GitHub에 액세스하는 경우 api.github.com을 api.SUBDOMAIN.ghe.com의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/OWNER/REPO/autolinks/AUTOLINK_IDResponse
Status: 200{
  "id": 1,
  "key_prefix": "TICKET-",
  "url_template": "https://example.com/TICKET?query=<num>",
  "is_alphanumeric": true
}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"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Administration" repository permissions (write)
"Delete an autolink reference from a repository"에 대한 매개 변수
| 속성, 형식, 설명 | 
|---|
| acceptstringSetting to  | 
| 속성, 형식, 설명 | 
|---|
| ownerstring RequiredThe account owner of the repository. The name is not case sensitive. | 
| repostring RequiredThe name of the repository without the  | 
| autolink_idinteger RequiredThe 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"에 대한 코드 샘플
GHE.com에서 GitHub에 액세스하는 경우 api.github.com을 api.SUBDOMAIN.ghe.com의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \
  -X DELETE \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/OWNER/REPO/autolinks/AUTOLINK_IDResponse
Status: 204