自
2025 年 9 月 8 日起,每个新订单项都需要声明是否会投放欧盟 (EU) 政治广告。Display & Video 360 API 和未提供声明的 SDF 上传操作将会失败。如需详细了解如何更新集成以进行此声明,请参阅我们的
弃用页面。
เริ่มใช้งาน
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Display & Video 360 API เป็นอินเทอร์เฟซแบบเป็นโปรแกรมสําหรับแพลตฟอร์ม Display & Video 360 คุณสามารถใช้ Display & Video 360 API เพื่อทำให้เวิร์กโฟลว์ Display & Video 360 ที่ซับซ้อนเป็นแบบอัตโนมัติ ตัวอย่างงานที่คุณทําได้ด้วย Display & Video 360 API มีดังนี้
คู่มือนี้จะอธิบายวิธีเริ่มต้นใช้งาน Display & Video 360 API
ข้อกำหนดเบื้องต้น
ก่อนใช้ Display & Video 360 API คุณต้องทําดังนี้
คุณต้องมีบัญชี Google คุณต้องมีบัญชี Google จึงจะสร้างโปรเจ็กต์ในคอนโซล Google API ได้ หากมีบัญชีอยู่แล้ว ก็ไม่ต้องทำอะไรเพิ่มเติม คุณอาจต้องใช้บัญชี Google แยกต่างหากเพื่อวัตถุประสงค์ในการทดสอบด้วย
คุณต้องมีสิทธิ์เข้าถึง Display & Video 360 คุณต้องมีสิทธิ์เข้าถึงผลิตภัณฑ์ Display & Video 360 จึงจะใช้ API ได้ หากองค์กรของคุณมีสัญญา Display & Video 360 อยู่แล้ว ให้ตรวจสอบว่าได้สร้างโปรไฟล์ผู้ใช้ที่มีสิทธิ์ที่เหมาะสมสำหรับบัญชี Google แล้ว หากไม่ใช่ โปรดติดต่อทีมขายเพื่อขอข้อมูลเพิ่มเติม
คุณควรลองใช้ Display & Video 360 เอกสารประกอบ API นี้ถือว่าคุณใช้ Display & Video 360 มาก่อน และคุณคุ้นเคยกับแนวคิดการเขียนโปรแกรมเว็บและรูปแบบข้อมูลเว็บ หากไม่เคยใช้ Display & Video 360 ให้ลองใช้ Web UI ก่อนเริ่มเขียนโค้ด
เลือกโปรเจ็กต์
คุณต้องสร้างหรือเลือกโปรเจ็กต์ในคอนโซล Google API และเปิดใช้ API
คุณจะสร้างโปรเจ็กต์ใหม่หรือใช้โปรเจ็กต์ที่มีอยู่ก็ได้
สร้างโปรเจ็กต์ใหม่
ทําตามขั้นตอนใน คอนโซล Google API เพื่อสร้างโปรเจ็กต์และเปิดใช้ Display & Video 360 API โดยอัตโนมัติ
ใช้โปรเจ็กต์ที่มีอยู่
ต่อไปนี้คือวิธีเปิดใช้งาน Display & Video 360 API ด้วยตนเองสําหรับโปรเจ็กต์ที่มีอยู่
หากต้องการเปิดใช้ API สําหรับโปรเจ็กต์ ให้ทําดังนี้
- เปิดไลบรารี API ในคอนโซล Google API หากได้รับข้อความแจ้ง ให้เลือกโปรเจ็กต์หรือสร้างโปรเจ็กต์ใหม่ คลัง API จะแสดง API ทั้งหมดที่ใช้ได้ โดยจัดกลุ่มตามตระกูลผลิตภัณฑ์และความนิยม
- หากไม่เห็น API ที่ต้องการเปิดใช้ในรายการ ให้ใช้การค้นหาเพื่อค้นหา
- เลือก API ที่ต้องการเปิดใช้ แล้วคลิกปุ่มเปิดใช้
- เปิดใช้การเรียกเก็บเงินหากได้รับข้อความแจ้ง
- ยอมรับข้อกำหนดในการให้บริการของ API หากได้รับข้อความแจ้ง
สร้างข้อมูลเข้าสู่ระบบ
คำขอทั้งหมดที่คุณส่งไปยัง Display & Video 360 API ต้องได้รับอนุญาต อ่านภาพรวมคร่าวๆ เกี่ยวกับการให้สิทธิ์ได้ที่หัวข้อวิธีให้สิทธิ์และระบุแอปพลิเคชันของคุณกับ Google
วิธีการต่อไปนี้จะช่วยแนะนำขั้นตอนการสร้างรหัสไคลเอ็นต์ OAuth 2.0 เพื่อใช้กับขั้นตอนแอปพลิเคชันที่ติดตั้ง ดูวิธีการสร้างข้อมูลเข้าสู่ระบบเพื่อใช้กับขั้นตอนของบัญชีบริการได้ที่คู่มือบัญชีบริการ
ทําตามขั้นตอนเพื่อกําหนดค่าโปรเจ็กต์คอนโซล Google API
- เปิดหน้าข้อมูลเข้าสู่ระบบใน API Console
คลิกสร้างข้อมูลเข้าสู่ระบบ > รหัสไคลเอ็นต์ OAuth
เลือกประเภทแอปพลิเคชันที่เหมาะสมที่สุดเมื่อได้รับข้อความแจ้ง ข้อมูลโค้ด Java และ Python ที่นำเสนอในคู่มือเหล่านี้จะอิงตามแอปบนเดสก์ท็อป ส่วนข้อมูลโค้ด PHP จะอิงตามเว็บแอปพลิเคชัน
ป้อนข้อมูลเพิ่มเติมที่จำเป็น
- หากนี่เป็นการสร้างรหัสไคลเอ็นต์ครั้งแรก นอกจากการเลือกประเภทแอปพลิเคชันแล้ว คุณยังกำหนดค่าหน้าจอขอความยินยอมได้โดยคลิกปุ่มกำหนดค่าหน้าจอขอความยินยอม คุณจะไม่ได้รับข้อความแจ้งให้กำหนดค่าหน้าจอขอความยินยอมอีกครั้งหลังจากดำเนินการครั้งแรกแล้ว แม้ว่าจะอัปเดตข้อมูลนี้ได้ทุกเมื่อ
คลิกสร้าง
เมื่อดำเนินการเสร็จแล้ว คุณจะเห็นรหัสไคลเอ็นต์ OAuth 2.0 และรหัสลับไคลเอ็นต์ ซึ่งคุณสามารถดาวน์โหลดในรูปแบบ JSON และบันทึกไว้ใช้ภายหลังได้
เมื่อคุณใช้ OAuth 2.0 สำหรับการตรวจสอบสิทธิ์ ระบบจะตรวจสอบสิทธิ์ผู้ใช้หลังจากที่ผู้ใช้ยอมรับข้อกำหนดที่ปรากฏให้เห็นในหน้าจอคำยินยอมของผู้ใช้
หากต้องการตั้งค่าหน้าจอความยินยอมของโปรเจ็กต์ ให้ทําดังนี้
- เปิดหน้าหน้าจอขอความยินยอมในคอนโซล Google API
เมื่อได้รับข้อความแจ้ง ให้เลือกโปรเจ็กต์หรือสร้างโปรเจ็กต์ใหม่
- กรอกแบบฟอร์มแล้วคลิกบันทึก
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[[["\u003cp\u003eThe Display & Video 360 API allows programmatic access to automate complex workflows within the Display & Video 360 platform, including tasks like creative management, line item targeting, and structured data file generation.\u003c/p\u003e\n"],["\u003cp\u003eBefore using the API, ensure you have a Google Account, access to Display & Video 360, and familiarize yourself with the platform's web UI.\u003c/p\u003e\n"],["\u003cp\u003eYou need to create or select a Google API Console project and enable the Display & Video 360 API to start using it.\u003c/p\u003e\n"],["\u003cp\u003eGenerate OAuth 2.0 credentials for authorization, following the guide for either installed application or service account flow depending on your needs.\u003c/p\u003e\n"],["\u003cp\u003eConfigure a user consent screen for your project within the Google API Console to handle user authentication when using OAuth 2.0.\u003c/p\u003e\n"]]],["The Display & Video 360 API automates tasks like uploading creatives, managing line items and targeting, and generating Structured Data Files. To begin, users need a Google Account and Display & Video 360 access, alongside experience with the platform. They must create or select a project in the Google API Console and enable the API. Credentials, specifically an OAuth 2.0 client ID, must be generated, and the user consent screen must be configured to enable application authorization.\n"],null,["The Display \\& Video 360 API is the programmatic interface for the Display \\& Video 360\nplatform. You can use the Display \\& Video 360 API to automate complex\nDisplay \\& Video 360 workflows. Here are some examples of tasks you can do with the\nDisplay \\& Video 360 API:\n\n- [Upload and build\n creatives.](/display-video/api/guides/creating-creatives/overview)\n- [Manage line items and their\n targeting.](/display-video/api/guides/managing-line-items/overview)\n- [Generate and download Structured Data\n Files.](/display-video/api/guides/downloading-sdfs/create)\n\nThis guide describes how to get started with the Display \\& Video 360 API.\n\nPrerequisites\n\nBefore using the Display \\& Video 360 API, you must do the following:\n\n1. **You must have a Google Account.** You need a\n [Google Account](//www.google.com/accounts/NewAccount) in order to [create a project](#create_project)\n in the Google API Console. If you already have an\n account, then you're all set. You may also want a separate Google Account for\n testing purposes.\n\n2. **You must have access to Display \\& Video 360.** You need access to the\n Display \\& Video 360 product in order to work with the API. If your\n organization already has a Display \\& Video 360 contract, ensure a\n [user profile](//support.google.com/displayvideo/answer/2723011) with appropriate permissions has been\n created for your Google Account(s). If not,\n [contact our sales team](//marketingplatform.google.com/about/display-video-360/) for more information.\n\n3. **You should try out Display \\& Video 360.** This API documentation assumes\n that you've used Display \\& Video 360, and that you're familiar with web\n programming concepts and web data formats. If you haven't used\n Display \\& Video 360, then try out the [web UI](https://displayvideo.google.com/) before\n starting to code.\n\nChoose a project\n\nYou need to [create\nor select a project in the Google API Console and enable the API](https://console.cloud.google.com/start/api?id=displayvideo.googleapis.com&credential=client_key).\n\nYou can create a new project, or use an existing one.\n\nCreate a new project\n\nFollow the steps in the [Google API Console](https://console.cloud.google.com/start/api?id=displayvideo.googleapis.com&credential=client_key)\nto create a project and enable the Display \\& Video 360 API automatically.\n\nUse an existing project\n\nHere's how to manually activate the Display \\& Video 360 API for an existing project.\n\nTo enable an API for your project, do the following:\n\n1. [Open the API Library](https://console.cloud.google.com/apis/library) in the Google API Console. If prompted, select a project or create a new one. The API Library lists all available APIs, grouped by product family and popularity.\n2. If the API you want to enable isn't visible in the list, use search to find it.\n3. Select the API you want to enable, then click the **Enable** button.\n4. If prompted, enable billing.\n5. If prompted, accept the API's Terms of Service.\n\nGenerate credentials\n\nAll requests you make to the Display \\& Video 360 API must be authorized. For a brief\noverview of authorization, read about how to [authorize and identify your\napplication to Google](/display-video/api/guides/how-tos/authorizing).\n\nThe following instructions guide you through the process of creating an OAuth\n2.0 client ID to use with the [installed application\nflow](/identity/protocols/OAuth2InstalledApp). For instructions on generating credentials for use\nwith the service account flow, refer to the [Service Accounts](/display-video/api/guides/how-tos/service-account)\nguide.\n\n1. Follow the steps to [configure a Google API Console project](#create_project).\n\n\n2. Open the [Credentials page](https://console.cloud.google.com/apis/credentials) in the API Console.\n3. Click **Create credentials** \\\u003e **OAuth client ID**.\n\n4. Select the most applicable application type when prompted. The Java and\n Python code snippets offered in these guides assume a **Desktop app** , while\n the PHP code snippets assume a **Web application**.\n\n5. Enter any additional required information.\n\n - If this is your first time creating a client ID, besides being able to select your application type, you can configure your consent screen by clicking the **Configure consent screen** button. You won't get a prompt to configure your consent screen again after you do it the first time, although this information can be updated at any time.\n6. Click **Create**.\n\nWhen done, you'll be presented with an OAuth 2.0 client ID and client\nsecret, which you can download in JSON format and save for later use.\n\nConfigure the user consent screen\n\nWhen you use OAuth 2.0 for authentication, your users are authenticated after\nthey agree to terms presented to them on a user consent screen.\n\n\nTo set up your project's consent screen, do the following:\n\n1. Open the [Consent Screen page](https://console.cloud.google.com/apis/credentials/consent) in the Google API Console. If prompted, select a project or create a new one.\n2. Fill out the form and click **Save**."]]