Generate and use OAuth 2.0 to authenticate requests to the Display & Video 360 API.
Выберите проект
Use a Google Cloud project to generate OAuth 2.0 credentials.
You can create a new project or use an existing one.
Создать новый проект
Follow the steps in the Google Cloud console to create a project and enable the Display & Video 360 API.
Используйте существующий проект
To activate the Display & Video 360 API for an existing project:
- Open the API Library in the Google Cloud console. If prompted, select a project. The API Library lists all available APIs. The Display & Video 360 API is labeled Display & Video 360 API .
- If you don't see the API, use the search bar to find it.
- Select Display & Video 360 API , then click Enable.
- При появлении запроса активируйте оплату.
- При появлении запроса примите Условия использования API.
Сгенерировать учетные данные
After you've enabled the API for a project, generate an OAuth 2.0 client ID. Use this client ID to authenticate Display & Video 360 API requests.
To create an OAuth 2.0 client ID to use with an installed application flow :
- Выберите свой проект в Google Cloud.
- Open the Credentials page in the Google Cloud console.
- Нажмите «Создать учетные данные» > «Идентификатор клиента OAuth» .
- Select an application type when prompted. The Java and Python code snippets in the provided guides are for a Desktop app . The PHP code snippets are for a Web application .
- Enter any other required information. If this is your first time creating a client ID, click Configure consent screen and proceed through the prompts. You can update this information at any time.
- Нажмите «Создать».
This creates an OAuth 2.0 client ID and client secret. Download these in JSON format.
Настройте экран согласия пользователя.
When using OAuth 2.0, users agree to terms on a user consent screen before authentication.
Чтобы настроить экран согласия для вашего проекта:
- Open the OAuth consent screen page in the Google Cloud console . If prompted, select a project or create a new one.
- Заполните форму.
- Нажмите « Сохранить ».