Od 8 września 2025 r. każdy nowy element zamówienia będzie musiał deklarować, czy będzie wyświetlać reklamy polityczne w Unii Europejskiej (UE). Przesyłanie plików SDF i wywoływanie interfejsu Display & Video 360 API bez deklaracji zakończy się niepowodzeniem. Więcej informacji o tym, jak zaktualizować integrację, aby złożyć to oświadczenie, znajdziesz na naszej stronie dotyczącej wycofania.
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Interfejs Display & Video 360 API to interfejs do automatyzacji platformy Display & Video 360. Za pomocą interfejsu Display & Video 360 API możesz zautomatyzować złożone przepływy pracy w Display & Video 360. Oto kilka przykładowych zadań, które możesz wykonywać za pomocą interfejsu Display & Video 360 API:
W tym przewodniku znajdziesz informacje o tym, jak zacząć korzystać z interfejsu Display & Video 360 API.
Wymagania wstępne
Zanim zaczniesz korzystać z interfejsu Display & Video 360 API, musisz:
Musisz mieć konto Google. Aby utworzyć projekt w Konsoli interfejsów API Google, musisz mieć konto Google. Jeśli masz już konto, nie musisz nic więcej robić. Możesz też utworzyć osobne konto Google na potrzeby testowania.
Musisz mieć dostęp do Display & Video 360. Aby korzystać z interfejsu API, musisz mieć dostęp do usługi Display & Video 360. Jeśli Twoja organizacja ma już umowę Display & Video 360, sprawdź, czy dla Twoich kont Google został utworzony profil użytkownika z odpowiednimi uprawnieniami. Jeśli nie, skontaktuj się z naszym zespołem sprzedaży, aby uzyskać więcej informacji.
Wypróbuj Display & Video 360. Ta dokumentacja interfejsu API zakłada, że korzystasz z Display & Video 360 i znajomisz się z koncepcjami programowania stron internetowych oraz formatami danych internetowych. Jeśli nie korzystasz jeszcze z Display & Video 360, przed rozpoczęciem kodowania wypróbuj interfejs internetowy.
Możesz utworzyć nowy projekt lub użyć istniejącego.
Utwórz nowy projekt
Aby utworzyć projekt i automatycznie włączyć interfejs Display & Video 360 API, wykonaj instrukcje podane w Konsoli interfejsów API Google.
Korzystanie z istniejącego projektu
Oto, jak ręcznie aktywować interfejs Display & Video 360 API w istniejącym projekcie.
Aby włączyć interfejs API w projekcie, wykonaj te czynności:
Otwórz Bibliotekę API w konsoli interfejsów API Google. Jeśli pojawi się taka prośba, wybierz projekt lub utwórz nowy. Biblioteka interfejsów API zawiera listę wszystkich dostępnych interfejsów API, pogrupowanych według rodziny produktów i popularności.
Jeśli interfejs API, który chcesz włączyć, nie jest widoczny na liście, wyszukaj go.
Wybierz interfejs API, który chcesz włączyć, a następnie kliknij przycisk Włącz.
Jeśli pojawi się taka prośba, włącz płatności.
Jeśli pojawi się taka prośba, zaakceptuj Warunki korzystania z usługi interfejsu API.
Generowanie danych logowania
Wszystkie żądania wysyłane do interfejsu Display & Video 360 API muszą być autoryzowane. Aby uzyskać krótkie omówienie autoryzacji, przeczytaj artykuł o tym, jak autoryzować aplikację i identyfikować ją w Google.
W tych instrukcjach znajdziesz informacje o tworzeniu identyfikatora klienta OAuth 2.0 do użycia w przepływie dla zainstalowanej aplikacji. Instrukcje dotyczące generowania danych logowania do korzystania z procesu tworzenia konta usługi znajdziesz w przewodniku Konta usługi.
Kliknij Utwórz dane logowania > Identyfikator klienta OAuth.
Gdy pojawi się odpowiedni komunikat, wybierz najbardziej odpowiedni typ aplikacji. Fragmenty kodu w języku Java i Python, które znajdziesz w tych przewodnikach, są przeznaczone do aplikacji na komputer, a fragmenty kodu PHP – do aplikacji internetowej.
Wpisz dodatkowe wymagane informacje.
Jeśli po raz pierwszy tworzysz identyfikator klienta, oprócz możliwości wyboru typu aplikacji możesz skonfigurować ekran zgody, klikając przycisk Skonfiguruj ekran zgody. Po skonfigurowaniu ekranu zgody po raz pierwszy nie pojawi się on ponownie, chociaż te informacje można zaktualizować w dowolnym momencie.
Kliknij Utwórz.
Po zakończeniu zobaczysz identyfikator klienta OAuth 2.0 i obiekt tajny klienta, które możesz pobrać w formacie JSON i zapisać na później.
Konfigurowanie ekranu zgody użytkownika
Gdy do uwierzytelniania używasz protokołu OAuth 2.0, użytkownicy są uwierzytelniani po wyrażeniu zgody na warunki wyświetlone na ekranie akceptacji.
Aby skonfigurować ekran zgody w projekcie:
Otwórz w konsoli interfejsów API Google stronę Ekran zgody.
Jeśli pojawi się monit, wybierz projekt lub utwórz nowy.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 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**."]]