YouTube에서 Shorts 동영상의 조회수를 집계하는 방식에 맞게 Data API를 업데이트하고 있습니다.
자세히 알아보기
ChannelBanners: insert
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
YouTube에 채널 배너 이미지를 업로드합니다. 이 메소드는 다음과 같이 채널의 배너 이미지를 업데이트하는 3단계 절차 중 처음 두 단계를 나타냅니다.
channelBanners.insert
메서드를 호출하여 바이너리 이미지 데이터를 YouTube에 업로드합니다. 이미지의 가로세로 비율은 16:9여야 하며, 크기는 2048x1152픽셀 이상이어야 합니다. 2560x1440픽셀 이미지를 업로드하는 것이 좋습니다.- API가 1단계에서 반환하는 응답에서
url
속성 값을 추출합니다. channels.update
메서드를 호출하여 채널의 브랜딩 설정을 업데이트합니다. brandingSettings.image.bannerExternalUrl
속성 값을 2단계에서 가져온 URL로 설정합니다.
이 메서드는 미디어 업로드를 지원합니다. 업로드한 파일은 다음 제한사항을 따라야 합니다.
- 최대 파일 크기: 6MB
- 허용되는 미디어 MIME 유형:
image/jpeg
, image/png
, application/octet-stream
할당량 영향: 이 메서드를 호출하면 할당량 비용이 50단위가 됩니다.
요청
HTTP 요청
POST https://www.googleapis.com/upload/youtube/v3/channelBanners/insert
승인
이 요청에는 다음 범위 중 하나 이상에 대한 승인이 필요합니다. 인증 및 승인에 대해 자세히 알아보려면 OAuth 2.0 승인 구현을 참고하세요.
범위 |
https://www.googleapis.com/auth/youtube.upload |
https://www.googleapis.com/auth/youtube |
https://www.googleapis.com/auth/youtube.force-ssl |
매개변수
다음 표에는 이 쿼리가 지원하는 매개변수가 나와 있습니다. 나열된 모든 매개변수는 쿼리 매개변수입니다.
매개변수 |
선택적 매개변수 |
onBehalfOfContentOwner |
string
이 매개변수는 적절하게 승인된 요청에서만 사용할 수 있습니다.
참고: 이 매개변수는 YouTube 콘텐츠 파트너 전용입니다.
onBehalfOfContentOwner 매개변수는 요청의 승인 사용자 인증 정보가 매개변수 값에 지정된 콘텐츠 소유자를 대신하는 YouTube CMS 사용자를 식별함을 나타냅니다. 이 매개변수는 여러 YouTube 채널을 소유하고 관리하는 YouTube 콘텐츠 파트너를 위해 마련되었습니다. 콘텐츠 소유자는 한 번 인증하면 개별 채널에 대한 인증 사용자 인증 정보를 제공하지 않고도 모든 동영상 및 채널 데이터에 액세스할 수 있습니다. 사용자가 인증할 CMS 계정은 지정된 YouTube 콘텐츠 소유자에게 연결되어야 합니다. |
요청 본문
이 메소드를 호출할 때 요청 본문을 제공하지 마세요.
오류
다음 표에는 이 메서드 호출에 대한 응답으로 API에서 반환할 수 있는 오류 메시지가 나와 있습니다. 자세한 내용은 YouTube Data API - 오류를 참고하세요.
오류 유형 |
오류 세부정보 |
설명 |
badRequest (400) |
bannerAlbumFull |
YouTube 채널 아트 앨범에 이미지가 너무 많습니다. 이 문제를 해결하려면 Google 포토로 이동한 다음 앨범 페이지로 이동하여 해당 앨범에서 일부 이미지를 삭제하세요. |
badRequest (400) |
mediaBodyRequired |
요청에 이미지 콘텐츠가 포함되어 있지 않습니다. |
사용해 보기
APIs Explorer를 사용하여 이 API를 호출하고 API 요청 및 응답을 확인합니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-12-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"]],["최종 업데이트: 2024-12-21(UTC)"],[[["\u003cp\u003eThis method allows you to upload a channel banner image to YouTube, which is the initial stage of a three-step process for updating a channel's banner image.\u003c/p\u003e\n"],["\u003cp\u003eThe image uploaded must adhere to specific constraints, requiring a 16:9 aspect ratio, a minimum resolution of 2048x1152 pixels (recommended 2560x1440), a maximum file size of 6MB, and supported MIME types including \u003ccode\u003eimage/jpeg\u003c/code\u003e, \u003ccode\u003eimage/png\u003c/code\u003e, and \u003ccode\u003eapplication/octet-stream\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAfter uploading the image, you need to extract the URL from the API response and use it in the \u003ccode\u003echannels.update\u003c/code\u003e method to set the channel's \u003ccode\u003ebannerExternalUrl\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eUtilizing this API method will incur a quota cost of 50 units, and it necessitates authorization with one of the specified scopes: \u003ccode\u003ehttps://www.googleapis.com/auth/youtube.upload\u003c/code\u003e, \u003ccode\u003ehttps://www.googleapis.com/auth/youtube\u003c/code\u003e, or \u003ccode\u003ehttps://www.googleapis.com/auth/youtube.force-ssl\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe content owner can use the \u003ccode\u003eonBehalfOfContentOwner\u003c/code\u003e optional parameter to make the request, by authenticating with their CMS account, allowing to manage multiple channels.\u003c/p\u003e\n"]]],["To update a YouTube channel banner, first, use the `channelBanners.insert` method to upload a 16:9 aspect ratio image (at least 2048x1152 pixels, recommended 2560x1440px). The image file must be under 6MB and of `image/jpeg`, `image/png`, or `application/octet-stream` type. Then, extract the image URL from the API response. Finally, use the `channels.update` method to set the `brandingSettings.image.bannerExternalUrl` to the extracted URL. This method has a quota cost of 50 units.\n"],null,["# ChannelBanners: insert\n\nUploads a channel banner image to YouTube. This method represents the first two steps in a three-step process to update the banner image for a channel:\n\n\u003cbr /\u003e\n\n1. Call the `channelBanners.insert` method to upload the binary image data to YouTube. The image must have a 16:9 aspect ratio and be at least 2048x1152 pixels. We recommend uploading a 2560px by 1440px image.\n2. Extract the `url` property's value from the response that the API returns for step 1.\n3. Call the [channels.update](/youtube/v3/docs/channels/update) method to update the channel's branding settings. Set the [brandingSettings.image.bannerExternalUrl](/youtube/v3/docs/channels#brandingSettings.image.bannerExternalUrl) property's value to the URL obtained in step 2.\n\n\u003cbr /\u003e\n\nThis method supports media upload. Uploaded files must conform to these constraints:\n\n- **Maximum file size:** 6MB\n- **Accepted Media MIME types:** `image/jpeg`, `image/png`, `application/octet-stream`\n\n**Quota impact:** A call to this method has a [quota cost](/youtube/v3/getting-started#quota) of 50 units.\n\nRequest\n-------\n\n### HTTP request\n\n```\nPOST https://www.googleapis.com/upload/youtube/v3/channelBanners/insert\n```\n\n### Authorization\n\nThis request requires authorization with at least one of the following scopes. To read more about authentication and authorization, see [Implementing OAuth 2.0 authorization](/youtube/v3/guides/authentication).\n\n| Scope |\n|-----------------------------------------------------|\n| `https://www.googleapis.com/auth/youtube.upload` |\n| `https://www.googleapis.com/auth/youtube` |\n| `https://www.googleapis.com/auth/youtube.force-ssl` |\n\n### Parameters\n\nThe following table 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/v3/guides/authentication). **Note:** This parameter is intended exclusively for YouTube content partners. The **onBehalfOfContentOwner** parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. 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 CMS account that the user authenticates with must be linked to the specified YouTube content owner. |\n\n### Request body\n\nDo not provide a request body when calling this method.\n\nResponse\n--------\n\nIf successful, this method returns a [channelBanner](/youtube/v3/docs/channelBanners#resource) resource in the response body.\n\nErrors\n------\n\nThe following table identifies error messages that the API could return in response to a call to this method. For more details, see [YouTube Data API - Errors](/youtube/v3/docs/errors).\n\n| Error type | Error detail | Description |\n|--------------------|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `badRequest (400)` | `bannerAlbumFull` | Your YouTube Channel Art album has too many images. To fix this, go to [Google Photos](http://photos.google.com), then navigate to the albums page and remove some images from that album. |\n| `badRequest (400)` | `mediaBodyRequired` | The request does not include the image content. |\n\nTry it!\n-------\n\nUse the APIs Explorer to call this API and see the API request and response."]]