自
2025 年 9 月 8 日起,每個新委刊項都必須聲明是否會放送歐盟政治廣告。如果透過 Display & Video 360 API 和 SDF 上傳的檔案未提供聲明,系統就會失敗。如要進一步瞭解如何更新整合服務以進行這項聲明,請參閱
淘汰項目頁面。
Method: advertisers.assets.upload
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
上傳素材資源。如果上傳成功,就會傳回新上傳資產的 ID。素材資源檔案大小不得超過 10 MB (圖片)、200 MB (ZIP 檔案) 和 1 GB (影片)。
必須在多部分媒體上傳程序中使用。如需使用提供的用戶端程式庫的範例,請參閱建立廣告素材指南。
HTTP 要求
- 上傳 URI,適用於媒體上傳要求:
POST https://displayvideo.googleapis.com/upload/v4/advertisers/{advertiserId}/assets
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
advertiserId |
string (int64 format)
必要欄位。這項素材資源所屬廣告主的 ID。
|
要求主體
要求主體的資料會採用以下結構:
JSON 表示法 |
{
"filename": string
} |
欄位 |
filename |
string
必要欄位。素材資源的檔案名稱,包括副檔名。 檔案名稱必須採用 UTF-8 編碼,且大小不得超過 240 位元組。
|
回應主體
assets.upload
的回應訊息。
如果成功,回應主體會含有以下結構的資料:
JSON 表示法 |
{
"asset": {
object (Asset )
}
} |
欄位 |
asset |
object (Asset )
上傳的素材資源 (如果上傳成功)。
|
授權範圍
需要下列 OAuth 範圍:
https://www.googleapis.com/auth/display-video
詳情請參閱 OAuth 2.0 Overview。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],null,["# Method: advertisers.assets.upload\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.CreateAssetResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nUploads an asset. Returns the ID of the newly uploaded asset if successful. The asset file size should be no more than 10 MB for images, 200 MB for ZIP files, and 1 GB for videos.\n\nMust be used within the [multipart media upload process](/display-video/api/guides/how-tos/upload#multipart). Examples using provided client libraries can be found in our [Creating Creatives guide](/display-video/api/guides/creating-creatives/overview#upload_an_asset).\n\n### HTTP request\n\n- Upload URI, for media upload requests: \n `POST https://displayvideo.googleapis.com/upload/v4/advertisers/{advertiserId}/assets`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| `advertiserId` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Required. The ID of the advertiser this asset belongs to. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|--------------------------------|\n| ``` { \"filename\": string } ``` |\n\n| Fields ||\n|------------|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| `filename` | `string` Required. The filename of the asset, including the file extension. The filename must be UTF-8 encoded with a maximum size of 240 bytes. |\n\n### Response body\n\nA response message for [assets.upload](/display-video/api/reference/rest/v4/advertisers.assets/upload#google.ads.displayvideo.v4.AssetService.CreateAsset).\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------|\n| ``` { \"asset\": { object (/display-video/api/reference/rest/v4/advertisers.creatives#Asset) } } ``` |\n\n| Fields ||\n|---------|---------------------------------------------------------------------------------------------------------------------------|\n| `asset` | `object (`[Asset](/display-video/api/reference/rest/v4/advertisers.creatives#Asset)`)` The uploaded asset, if successful. |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/display-video`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2)."]]