Skip to main content
이제 REST API의 버전이 지정되었습니다. 자세한 내용은 "API 버전 관리 정보"를 참조하세요.

조직 상호 작용에 대한 REST API 엔드포인트

REST API를 사용하면 조직의 퍼블릭 리포지토리에서 댓글을 달거나, 이슈를 열거나, 끌어오기 요청을 만들 수 있는 사용자 유형을 일시적으로 제한할 수 있습니다.

조직 상호 작용 정보

조직 소유자가 조직의 퍼블릭 리포지토리에서 댓글을 달거나, 이슈를 열거나, 끌어오기 요청을 만들 수 있는 사용자 유형을 일시적으로 제한할 수 있습니다. 제한을 사용하도록 설정하면 지정된 유형의 GitHub 사용자만 상호 작용에 참여할 수 있습니다. 제한은 정의된 기간 후에 자동으로 만료됩니다. GitHub 사용자 유형에 대한 자세한 내용은 다음과 같습니다.

  • 조직의 기존 사용자: 상호 작용을 existing_users로 제한하면 이전에 기여하지 않고 협력자가 아니며 계정이 생성된 지 24시간 미만인 신규 사용자가 일시적으로 제한됩니다..
  • 조직의 기여자만: 상호 작용을 contributors_only로 제한할 때 이전에 기여하지 않았으며 협력자도 아닌 사용자는 일시적으로 제한됩니다..
  • 조직의 협력자만 해당: 상호 작용을 collaborators_only으로 제한하면 협력자가 아닌 사용자가 일시적으로 제한됩니다..

조직 수준에서 상호 작용 제한을 설정하면 조직이 소유한 개별 리포지토리에 대해 설정된 모든 상호 작용 제한을 덮어씁니다. 조직 소유의 개별 리포지토리에 대해 서로 다른 상호 작용 제한을 설정하려면 리포지토리 상호 작용 엔드포인트를 대신 사용합니다.

Get interaction restrictions for an organization

Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response.

"Get interaction restrictions for an organization"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 토큰 형식에서 작동합니다.:

토큰에 다음 권한 집합이 있어야 합니다.:

  • organization_administration:read

"Get interaction restrictions for an organization"에 대한 매개 변수

헤더
이름, Type, 설명
accept string

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

경로 매개 변수
이름, Type, 설명
org string Required

The organization name. The name is not case sensitive.

"Get interaction restrictions for an organization"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

"Get interaction restrictions for an organization"에 대한 코드 샘플

요청 예제

get/orgs/{org}/interaction-limits
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/orgs/ORG/interaction-limits

Response

Status: 200
{ "limit": "collaborators_only", "origin": "organization", "expires_at": "2018-08-17T04:18:39Z" }

Set interaction restrictions for an organization

Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization.

"Set interaction restrictions for an organization"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 토큰 형식에서 작동합니다.:

토큰에 다음 권한 집합이 있어야 합니다.:

  • organization_administration:write

"Set interaction restrictions for an organization"에 대한 매개 변수

헤더
이름, Type, 설명
accept string

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

경로 매개 변수
이름, Type, 설명
org string Required

The organization name. The name is not case sensitive.

본문 매개 변수
이름, Type, 설명
limit string Required

The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect.

다음 중 하나일 수 있습니다.: existing_users, contributors_only, collaborators_only

expiry string

The duration of the interaction restriction. Default: one_day.

다음 중 하나일 수 있습니다.: one_day, three_days, one_week, one_month, six_months

"Set interaction restrictions for an organization"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

422

Validation failed, or the endpoint has been spammed.

"Set interaction restrictions for an organization"에 대한 코드 샘플

요청 예제

put/orgs/{org}/interaction-limits
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/interaction-limits \ -d '{"limit":"collaborators_only","expiry":"one_month"}'

Response

Status: 200
{ "limit": "collaborators_only", "origin": "organization", "expires_at": "2018-08-17T04:18:39Z" }

Remove interaction restrictions for an organization

Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions.

"Remove interaction restrictions for an organization"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 토큰 형식에서 작동합니다.:

토큰에 다음 권한 집합이 있어야 합니다.:

  • organization_administration:write

"Remove interaction restrictions for an organization"에 대한 매개 변수

헤더
이름, Type, 설명
accept string

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

경로 매개 변수
이름, Type, 설명
org string Required

The organization name. The name is not case sensitive.

"Remove interaction restrictions for an organization"에 대한 HTTP 응답 상태 코드

상태 코드설명
204

No Content

"Remove interaction restrictions for an organization"에 대한 코드 샘플

요청 예제

delete/orgs/{org}/interaction-limits
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/orgs/ORG/interaction-limits

Response

Status: 204