GroupItems: insert
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
요청
HTTP 요청
POST https://youtubeanalytics.googleapis.com/v2/groupItems
승인
이 요청에는 다음 범위 중 최소 하나를 사용하여 인증이 필요합니다. (인증 및 승인에 대해 자세히 알아보기)
범위 |
https://www.googleapis.com/auth/yt-analytics.readonly |
YouTube 콘텐츠에 관한 YouTube 분석 보고서 보기 이 범위를 사용하여 사용자 활동 측정항목(예: 조회수, 평가 횟수)을 조회할 수 있습니다. |
https://www.googleapis.com/auth/yt-analytics-monetary.readonly |
YouTube 콘텐츠에 대한 YouTube 분석 수익 보고서 보기 이 범위에서는 사용자 활동 측정항목, 예상 수익, 광고 실적 측정항목에 액세스할 수 있습니다. |
https://www.googleapis.com/auth/youtube |
YouTube 계정을 관리합니다. YouTube Analytics API에서 채널 소유자는 이 범위를 사용하여 YouTube 분석 그룹 및 그룹 항목을 관리합니다. |
https://www.googleapis.com/auth/youtubepartner |
YouTube에서 YouTube 저작물과 관련 콘텐츠를 보고 관리합니다. YouTube 분석 API에서 콘텐츠 소유자는 이 범위를 사용하여 YouTube 분석 그룹과 그룹 항목을 관리합니다. |
매개변수
아래 표에는 이 쿼리가 지원하는 매개변수가 나와 있습니다. 나열된 모든 매개변수는 쿼리 매개변수입니다.
매개변수 |
선택적 매개변수 |
onBehalfOfContentOwner |
string
이 매개변수는 적절하게 승인된 요청에서만 사용할 수 있습니다. 참고: 이 매개변수는 여러 YouTube 채널을 소유하고 관리하는 YouTube 콘텐츠 파트너만 사용할 수 있습니다.
onBehalfOfContentOwner 매개변수는 요청의 승인 사용자 인증 정보가 매개변수 값에 지정된 콘텐츠 소유자를 대신하는 YouTube 사용자를 식별함을 나타냅니다. 콘텐츠 소유자는 한 번 인증하면 개별 채널에 대한 인증 사용자 인증 정보를 제공하지 않고도 모든 동영상 및 채널 데이터에 액세스할 수 있습니다. 사용자가 인증하는 계정이 지정된 YouTube 콘텐츠 소유자와 연결되어 있어야 합니다. |
요청 본문
요청 본문에 groupItem 리소스를 제공합니다.
이 리소스의 경우 다음 속성 값을 지정해야 합니다.
응답
항목이 삽입되면 이 메서드는 응답 본문에 groupItem 리소스를 반환합니다.
요청에 지정된 항목이 요청 전에 이미 그룹에 포함된 경우 이 메서드는 HTTP 204
응답 코드 (No Content
)를 반환합니다.
오류
아래 표에는 이 메서드 호출에 대한 응답으로 API에서 반환할 수 있는 오류 메시지가 나와 있습니다. 자세한 내용은 오류 메시지 설명서를 참조하세요.
오류 유형 |
오류 세부정보 |
설명 |
forbidden (403) |
groupContainsMaximumNumberOfItems |
그룹에 이미 허용되는 최대 개수의 항목이 포함되어 있습니다. |
사용해 보기
APIs Explorer를 사용하여 이 API를 호출하고 API 요청 및 응답을 확인합니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-21(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-21(UTC)"],[[["\u003cp\u003eThis API endpoint allows you to create a new group item within YouTube Analytics.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization is required using specific scopes, including options for both content owners and channel owners.\u003c/p\u003e\n"],["\u003cp\u003eThe request must include a groupItem resource in the body, specifying the \u003ccode\u003egroupId\u003c/code\u003e and \u003ccode\u003eresource.id\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eA successful insertion of the item returns a groupItem resource, and attempting to add a pre-existing item returns a \u003ccode\u003e204\u003c/code\u003e HTTP code.\u003c/p\u003e\n"],["\u003cp\u003eThe API will return a \u003ccode\u003e403\u003c/code\u003e error if the group has reached its maximum item capacity.\u003c/p\u003e\n"]]],["This documentation details the process of creating a group item via a `POST` request to the YouTube Analytics API (`/groupItems`). Authorization requires specific scopes, including `yt-analytics.readonly`, `yt-analytics-monetary.readonly`, `youtube`, or `youtubepartner`. The request body must include a `groupItem` resource, specifying `groupId` and `resource.id`. Content owners can use `onBehalfOfContentOwner` to authenticate for multiple channels. Successful creation returns the `groupItem` resource; a duplicate returns a `204` status. A `403` error occurs when the maximum number of items is reached.\n"],null,["Creates a group item.\n\nRequest\n\nHTTP request \n\n```\nPOST https://youtubeanalytics.googleapis.com/v2/groupItems\n```\n\nAuthorization\n\nThis request requires authorization with at least one of the following scopes ([read more about authentication and authorization](/youtube/analytics/authentication)).\n\n| Scopes ||\n|----------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| https://www.googleapis.com/auth/yt-analytics.readonly | View YouTube Analytics reports for your YouTube content. This scope provides access to user activity metrics, like view counts and rating counts. |\n| https://www.googleapis.com/auth/yt-analytics-monetary.readonly | View YouTube Analytics monetary reports for your YouTube content. This scope provides access to user activity metrics and to estimated revenue and ad performance metrics. |\n| https://www.googleapis.com/auth/youtube | Manage your YouTube account. In the YouTube Analytics API, channel owners use this scope to manage YouTube Analytics groups and group items. |\n| https://www.googleapis.com/auth/youtubepartner | View and manage YouTube assets and associated content on YouTube. In the YouTube Analytics API, content owners use this scope to manage YouTube Analytics groups and group items. |\n\nParameters\n\nThe table below lists the parameters that this query supports. All of the parameters listed are query parameters.\n\n| Parameters ||\n|--------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| **Optional parameters** |||\n| `onBehalfOfContentOwner` | `string` This parameter can only be used in a properly [authorized request](/youtube/analytics/authentication). **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The **onBehalfOfContentOwner** parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner. |\n\nRequest body\n\nProvide a [groupItem resource](/youtube/analytics/reference/groupItems#resource) in the request body.\nFor that resource, you must specify a value for the following properties.\n\n\u003cbr /\u003e\n\n- `groupId`\n- `resource.id`\n\n\u003cbr /\u003e\n\nResponse\n\nIf the item is successfully inserted, this method returns a [groupItem resource](/youtube/analytics/reference/groupItems#resource) in the response body.\n\nIf the item specified in the request had already been included in the group before the request was made, this method returns an HTTP `204` response code (`No Content`).\n\nErrors\n\nThe table below identifies error messages that the API could return in response to a call to this method. Please see the [error message](/youtube/analytics/reference/errors) documentation for more detail.\n\n| Error type | Error detail | Description |\n|-------------------|-------------------------------------|-----------------------------------------------------------------|\n| `forbidden (403)` | `groupContainsMaximumNumberOfItems` | The group already contains the maximum allowed number of items. |\n\nTry it!\n\nUse the APIs Explorer to call this API and see the API request and response."]]