이제 Google 클래스룸 부가기능이 일반적으로 개발자에게 제공됩니다. 자세한 내용은
부가기능 문서를 참고하세요.
Method: registrations.create
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Registration
를 만들어 클래스룸에서 제공된 feed
에서 cloudPubSubTopic
에 제공된 대상에 알림을 보내기 시작합니다.
생성된 Registration
를 반환합니다. 현재는 인수와 동일하지만 expiryTime
및 id
와 같은 서버 할당 필드가 채워집니다.
expiryTime
또는 id
필드에 지정된 값은 무시됩니다.
클래스룸은 cloudPubSubTopic
의 유효성을 검사하고 최선의 방식으로 오류를 반환할 수 있지만, cloudPubSubTopic
가 존재하고 클래스룸에 게시할 권한이 있는지 확인하는 것은 호출자의 책임입니다.
이 메서드는 다음과 같은 오류 코드를 반환할 수 있습니다.
- 다음에 해당하는 경우
PERMISSION_DENIED
- 인증된 사용자에게 요청된 필드에서 알림을 받을 권한이 없습니다.
- 현재 사용자가 요청된 피드에 적절한 범위로 현재 Cloud 프로젝트에 대한 액세스 권한을 부여하지 않았습니다. 현재 이 목적으로 도메인 전체 권한 위임은 지원되지 않습니다. 요청에 적절한 범위가 있지만 부여가 없는 경우 [요청 오류][
@MissingGrant
오류] 가 반환됩니다.
- 다른 액세스 오류가 발생합니다.
- 다음에 해당하는 경우
INVALID_ARGUMENT
- 지정된
cloudPubsubTopic
가 없거나 지정된 cloudPubsubTopic
가 유효하지 않음
- 지정된
feed
가 없거나 지정된 feed
가 유효하지 않습니다.
- 다음에 해당하는 경우
NOT_FOUND
- 지정된
feed
를 찾을 수 없거나 요청하는 사용자에게 feed
의 존재 여부를 확인할 권한이 없습니다.
- 지정된
cloudPubsubTopic
를 찾을 수 없거나 클래스룸에 게시할 권한이 부여되지 않았습니다.
HTTP 요청
POST https://classroom.googleapis.com/v1/registrations
URL은 gRPC 트랜스코딩 구문을 사용합니다.
요청 본문
요청 본문에 Registration
의 인스턴스가 포함됩니다.
응답 본문
성공한 경우 응답 본문에 새로 생성된 Registration
의 인스턴스가 포함됩니다.
승인 범위
다음 OAuth 범위가 필요합니다.
https://www.googleapis.com/auth/classroom.push-notifications
자세한 내용은 승인 가이드를 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[],[],null,["# Method: registrations.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n\nCreates a `Registration`, causing Classroom to start sending notifications from the provided `feed` to the destination provided in `cloudPubSubTopic`.\n\nReturns the created `Registration`. Currently, this will be the same as the argument, but with server-assigned fields such as `expiryTime` and `id` filled in.\n\nNote that any value specified for the `expiryTime` or `id` fields will be ignored.\n\nWhile Classroom may validate the `cloudPubSubTopic` and return errors on a best effort basis, it is the caller's responsibility to ensure that it exists and that Classroom has permission to publish to it.\n\nThis method may return the following error codes:\n\n- `PERMISSION_DENIED` if:\n - the authenticated user does not have permission to receive notifications from the requested field; or\n - the current user has not granted access to the current Cloud project with the appropriate scope for the requested feed. Note that domain-wide delegation of authority is not currently supported for this purpose. If the request has the appropriate scope, but no grant exists, a \\[Request Errors\\]\\[`@MissingGrant` error\\] is returned.\n - another [access error](/workspace/classroom/reference/Access.Errors) is encountered.\n- `INVALID_ARGUMENT` if:\n - no `cloudPubsubTopic` is specified, or the specified `cloudPubsubTopic` is not valid; or\n - no `feed` is specified, or the specified `feed` is not valid.\n- `NOT_FOUND` if:\n - the specified `feed` cannot be located, or the requesting user does not have permission to determine whether or not it exists; or\n - the specified `cloudPubsubTopic` cannot be located, or Classroom has not been granted permission to publish to it.\n\n### HTTP request\n\n`POST https://classroom.googleapis.com/v1/registrations`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Request body\n\nThe request body contains an instance of [Registration](/workspace/classroom/reference/rest/v1/registrations#Registration).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Registration](/workspace/classroom/reference/rest/v1/registrations#Registration).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/classroom.push-notifications`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]