Watermarks: set
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
將浮水印圖片上傳至 YouTube,並為頻道設定浮水印。
這個方法支援媒體上傳功能。上傳的檔案必須符合下列限制:
- 檔案大小上限:10 MB
- 接受的媒體 MIME 類型:
image/jpeg
、image/png
、application/octet-stream
配額影響:呼叫此方法的配額費用為 50 個單位。
要求
HTTP 要求
POST https://www.googleapis.com/upload/youtube/v3/watermarks/set
授權
這項要求需要至少具備下列其中一個範圍的授權。如要進一步瞭解驗證和授權,請參閱「實作 OAuth 2.0 授權」。
範圍 |
https://www.googleapis.com/auth/youtubepartner |
https://www.googleapis.com/auth/youtube.upload |
https://www.googleapis.com/auth/youtube |
https://www.googleapis.com/auth/youtube.force-ssl |
參數
下表列出這項查詢支援的參數。列出的所有參數都是查詢參數。
參數 |
必要參數 |
channelId |
string
channelId 參數會指定要提供浮水印的 YouTube 頻道 ID。 |
選用參數 |
onBehalfOfContentOwner |
string
注意:這個參數僅供 YouTube 內容合作夥伴使用。
onBehalfOfContentOwner 參數表示要求的授權憑證,可識別代表參數值中指定內容擁有者的 YouTube CMS 使用者。這個參數適用於擁有及管理多個 YouTube 頻道的 YouTube 內容合作夥伴。這項功能可讓內容擁有者驗證一次,即可存取所有影片和頻道資料,不必為每個頻道提供驗證憑證。使用者驗證的 CMS 帳戶必須連結至指定的 YouTube 內容擁有者。 |
要求主體
請在要求主體中提供 watermark
資源。
回應
如果成功,這個方法會傳回 HTTP 204 No Content
狀態碼。
錯誤
下表列出 API 在回應對此方法的呼叫時可能傳回的錯誤訊息。詳情請參閱「YouTube Data API - 錯誤」。
錯誤類型 |
錯誤詳細資料 |
說明 |
badRequest (400) |
imageFormatUnsupported |
您提供的圖片格式不受支援。 |
badRequest (400) |
imageTooTall |
您提供的圖片過高。 |
badRequest (400) |
imageTooWide |
您提供的圖片過寬。 |
badRequest (400) |
mediaBodyRequired |
要求不包含圖片內容。 |
forbidden (403) |
forbidden |
無法為指定的頻道設定浮水印。要求可能未經過適當授權,或是 channelId 參數設為無效值。 |
試試看!
使用 APIs Explorer 呼叫此 API,並查看 API 要求和回應。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-23 (世界標準時間)。
[[["容易理解","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-11-23 (世界標準時間)。"],[[["This method enables uploading a watermark image to YouTube and applying it to a specific channel, supporting file sizes up to 10MB."],["Accepted image formats for the watermark include JPEG and PNG, and the method uses `application/octet-stream` as an accepted MIME type."],["Setting a watermark using this method consumes 50 quota units, and requires proper authorization using at least one of the specified scopes."],["The `channelId` is a required parameter, while `onBehalfOfContentOwner` is an optional parameter meant only for YouTube content partners."],["A successful request returns a `204 No Content` status, and common errors include unsupported image format, incorrect image dimensions, and missing image content."]]],["The content describes uploading a watermark image to a YouTube channel using the `watermarks/set` method. This process involves a POST request to the API endpoint, requiring a `channelId` parameter and authorization with specific scopes. The image file must be under 10MB and of `image/jpeg`, `image/png`, or `application/octet-stream` MIME type. This operation costs 50 quota units. A successful request returns a `204` status; errors can include invalid format, size issues, or authorization problems.\n"]]