Kể từ
ngày 8 tháng 9 năm 2025, mỗi mục hàng mới sẽ cần phải khai báo xem mục hàng đó có phân phát quảng cáo chính trị ở Liên minh Châu Âu (EU) hay không. Display & Video 360 API và các tệp SDF được tải lên mà không cung cấp thông tin khai báo sẽ không thành công. Hãy xem
trang thông báo về những nội dung không dùng nữa để biết thêm thông tin về cách cập nhật quy trình tích hợp để đưa ra nội dung khai báo này.
Bắt đầu
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
API Display & Video 360 là giao diện lập trình cho nền tảng Display & Video 360. Bạn có thể sử dụng API Display & Video 360 để tự động hoá các quy trình làm việc phức tạp trong Display & Video 360. Dưới đây là một số ví dụ về những việc bạn có thể làm bằng API Display & Video 360:
Hướng dẫn này mô tả cách bắt đầu sử dụng API Display & Video 360.
Điều kiện tiên quyết
Trước khi sử dụng API Display & Video 360, bạn phải làm như sau:
Bạn phải có Tài khoản Google. Bạn cần có một Tài khoản Google để tạo dự án trong Bảng điều khiển API của Google. Nếu đã có tài khoản thì bạn có thể bỏ qua bước này. Bạn cũng nên có một Tài khoản Google riêng cho mục đích thử nghiệm.
Bạn phải có quyền truy cập vào Display & Video 360. Bạn cần có quyền truy cập vào sản phẩm Display & Video 360 để làm việc với API. Nếu tổ chức của bạn đã có hợp đồng Display & Video 360, hãy đảm bảo rằng bạn đã tạo hồ sơ người dùng có các quyền thích hợp cho(các) Tài khoản Google của mình. Nếu không, hãy liên hệ với nhóm bán hàng của chúng tôi để biết thêm thông tin.
Bạn nên dùng thử Display & Video 360. Tài liệu API này giả định rằng bạn đã từng sử dụng Display & Video 360 và đã quen thuộc với các khái niệm lập trình web và định dạng dữ liệu web. Nếu bạn chưa từng sử dụng Display & Video 360, hãy thử giao diện người dùng web trước khi bắt đầu lập trình.
Chọn một dự án
Bạn cần tạo hoặc chọn một dự án trong Bảng điều khiển API của Google rồi bật API.
Bạn có thể tạo dự án mới hoặc sử dụng dự án hiện có.
Tạo dự án mới
Làm theo các bước trong Bảng điều khiển API của Google để tạo dự án và tự động bật API Display & Video 360.
Sử dụng dự án hiện có
Sau đây là cách kích hoạt API Display & Video 360 theo cách thủ công cho một dự án hiện có.
Để bật API cho dự án, hãy làm như sau:
- Mở Thư viện API trong Google API Console. Nếu bạn nhận được lời nhắc, hãy chọn một dự án hoặc tạo dự án mới. Thư viện API liệt kê tất cả những API có sẵn, được nhóm theo nhóm sản phẩm và mức độ phổ biến.
- Nếu API bạn muốn chọn không hiển thị trong danh sách, hãy sử dụng chức năng tìm kiếm để tìm API đó.
- Chọn API bạn muốn bật, sau đó nhấp vào nút Bật.
- Nếu bạn nhận được một lời nhắc, hãy bật tính năng thanh toán.
- Nếu bạn nhận được một lời nhắc, vui lòng chấp nhận Điều khoản dịch vụ của API.
Tạo thông tin xác thực
Tất cả yêu cầu bạn gửi đến API Display & Video 360 đều phải được uỷ quyền. Để biết thông tin tổng quan ngắn gọn về việc uỷ quyền, hãy đọc về cách uỷ quyền và xác định ứng dụng cho Google.
Hướng dẫn sau đây sẽ hướng dẫn bạn quy trình tạo mã ứng dụng khách OAuth 2.0 để sử dụng với quy trình ứng dụng đã cài đặt. Để biết hướng dẫn tạo thông tin xác thực để sử dụng với luồng tài khoản dịch vụ, hãy tham khảo hướng dẫn về Tài khoản dịch vụ.
Làm theo các bước để định cấu hình dự án Google API Console.
- Mở trang Thông tin xác thực trong API Console.
Nhấp vào Tạo thông tin xác thực > Mã ứng dụng OAuth.
Chọn loại ứng dụng phù hợp nhất khi được nhắc. Các đoạn mã Java và Python được cung cấp trong các hướng dẫn này giả định là Ứng dụng dành cho máy tính, trong khi các đoạn mã PHP giả định là Ứng dụng web.
Nhập mọi thông tin bắt buộc khác.
- Nếu đây là lần đầu tiên bạn tạo mã ứng dụng, ngoài việc chọn loại ứng dụng, bạn có thể định cấu hình màn hình yêu cầu đồng ý bằng cách nhấp vào nút Định cấu hình màn hình yêu cầu đồng ý. Bạn sẽ không nhận được lời nhắc thiết lập lại màn hình xin phép sau lần đầu tiên thiết lập, mặc dù bạn có thể cập nhật thông tin này bất cứ lúc nào.
Nhấp vào Tạo.
Khi hoàn tất, bạn sẽ thấy mã ứng dụng OAuth 2.0 và khoá ứng dụng. Bạn có thể tải mã này xuống ở định dạng JSON và lưu để sử dụng sau.
Khi bạn sử dụng OAuth 2.0 để xác thực, người dùng sẽ được xác thực sau khi họ đồng ý với các điều khoản được trình bày trên màn hình yêu cầu đồng ý của người dùng.
Để thiết lập màn hình xin phép cho dự án, hãy làm như sau:
- Mở trang Màn hình xin phép trong Google API Console.
Nếu bạn nhận được lời nhắc, hãy chọn một dự án hoặc tạo dự án mới.
- Điền thông tin vào biểu mẫu và nhấp vào mục Lưu.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-31 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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**."]]