승인 설정
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Search Ads 360 API는 모든 요청에 인증을 위한 OAuth 2.0 액세스 토큰을 지정해야 합니다. 표준 OAuth 2.0 인증 워크플로에 따라 토큰을 생성하고 Search Ads 360 API에 전달할 수 있습니다. 아래에 설명된 워크플로는 완전 자동화된 전환 업로드 및 보고서 다운로드에 적합하므로 권장합니다.
아래 설명된 워크플로의 대안은 설치된 애플리케이션에 OAuth 2.0 사용 또는
서버 간 애플리케이션에 OAuth 2.0 사용을 참조하세요. 대체 워크플로를 사용하는 경우 OAuth 2.0 승인 코드를 요청할 때 다음 값을 scope
매개변수로 지정합니다.
https://www.googleapis.com/auth/doubleclicksearch
서버 간 경로를 따르는 경우 서비스 계정을 Search Ads 360 사용자로 추가합니다.
권장 승인 워크플로
- Google API 콘솔로 이동하여 프로젝트를 선택합니다.
Google API 콘솔 프로젝트 및 OAuth 사용자 인증 정보를 아직 만들지 않았다면
클라이언트용 Google API 콘솔 프로젝트 및 OAuth 사용자 인증 정보
만들기의 안내를 따릅니다.
프로젝트의 OAuth 클라이언트 ID와 보안 비밀을 찾으려면 다음 단계를 따르세요.
- 사용자 인증 정보 페이지를 엽니다.
- 이름 열에서 OAuth 클라이언트의 이름을 클릭합니다.
- 클라이언트 ID 및 비밀번호가 페이지에 표시됩니다.
- 웹브라우저를 열고 Search Ads 360에서 데이터에 액세스할 권한이 있는 Google 계정으로 Google에 로그인
합니다.
API 클라이언트가 Search Ads 360에 인증하는 데 사용할 Google 계정입니다.
Google 계정 소유자가 회사를 떠나고 계정에서 Search Ads 360 액세스 권한을 삭제하는 경우 이 승인 워크플로를 반복하고 다른 Google 계정을 지정해야 합니다.
- 다음과 같이 Search Ads 360 유틸리티 스크립트를 호출하여 갱신 토큰을 받습니다.
sa360Api.py --login
이 스크립트에서는 OAuth 클라이언트 ID와 보안 비밀번호를 사용하여 갱신 토큰을 가져오는 프로세스를 안내합니다. 갱신 토큰은 이전 단계에서 로그인한 Google 계정에만 유효합니다.
이 과정에서 스크립트는 URL을 생성하고 웹브라우저에서 URL을 방문하도록 안내합니다.
-
브라우저에서 Search Ads 360 데이터에 대한 OAuth 클라이언트의 액세스를 허용할지 묻는 메시지가 표시되면
이전에 로그인한 Google 계정이 표시되는지 확인합니다. (여러 Google 계정에 로그인되어 있는 경우 다른 계정이 표시될 수 있습니다.)
프로세스가 끝나면 sa360Api.py
스크립트가 쉼표로 구분된 문자열을 출력합니다. 첫 번째 값은 제공한 클라이언트 ID이고 두 번째 값은 제공한 클라이언트 보안 비밀번호이고 세 번째 값은 새로고침 토큰입니다. 다음 출력 예시의 갱신 토큰은 굵은 텍스트로 되어 있습니다.
123456789123.apps.googleusercontent.com,ABCDEFGHIJKLMNOPQR_abcdef,1/HIJklM01OPQR23NOP456rst890uvw
- 클라이언트 ID, 클라이언트 보안 비밀번호, 갱신 토큰을 백엔드 데이터베이스 또는 애플리케이션에서 액세스할 수 있는 기타 안전한 위치에 저장합니다.
sa360Api.py
를 사용하여 샘플 JSON 요청을 Search Ads 360 API로 전송하려는 경우 쉼표로 구분된 전체 문자열을 편리한 위치에 유지합니다. 스크립트를 호출할 때마다 전체 문자열을 매개변수로 전달합니다.
- 다음을 실행하는 코드를 애플리케이션에 추가합니다.
- 클라이언트 ID, 클라이언트 암호, 갱신 토큰을 사용하여 새 OAuth 2.0 액세스 토큰을 가져옵니다.
- 새 액세스 토큰을 사용하여 Search Ads 360 API에 요청을 보냅니다.
클라이언트 라이브러리를 사용하는 경우 다음 섹션인 애플리케이션 설정에서 이 승인 코드를 애플리케이션에 추가하는 방법을 설명합니다.
클라이언트 라이브러리 중 하나를 사용하지 않는 경우 설치된 애플리케이션에 OAuth 2.0 사용에서 새 액세스 토큰을 가져오는 방법을 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-11-07(UTC)
[null,null,["최종 업데이트: 2024-11-07(UTC)"],[[["\u003cp\u003eThe Search Ads 360 API requires OAuth 2.0 access tokens for authentication, obtainable through standard OAuth 2.0 workflows or the recommended workflow outlined in the document.\u003c/p\u003e\n"],["\u003cp\u003eThe recommended workflow involves obtaining a refresh token using the provided utility script and storing it securely along with the client ID and secret.\u003c/p\u003e\n"],["\u003cp\u003eApplications should be designed to use the stored credentials to obtain fresh access tokens for API requests, as detailed in the "Set Up Your Application" section or relevant OAuth 2.0 documentation.\u003c/p\u003e\n"],["\u003cp\u003eAlternative workflows for installed or server-to-server applications are available with specific scope requirements and user management considerations.\u003c/p\u003e\n"]]],["The Search Ads 360 API requires OAuth 2.0 access tokens for authentication. The recommended workflow involves creating a Google API Console project and obtaining OAuth credentials. Users sign into a Google Account with Search Ads 360 access, then use the `sa360Api.py` script to generate a refresh token. The script outputs client ID, client secret, and refresh token. Store these securely, and use them in your application to obtain a fresh OAuth access token for API requests.\n"],null,["# Set Up Authorization\n\nThe Search Ads 360 API requires all requests to specify an [OAuth 2.0](/accounts/docs/OAuth2)\naccess token for authentication. You can follow any standard OAuth 2.0 authentication workflow\nto generate the token and pass it to the Search Ads 360 API. We recommend the workflow described\nbelow because it is suitable for fully automated conversion uploads and report downloads.\n\n\nFor alternatives to the workflow described below, see [Using\nOAuth 2.0 for Installed Applications](https://developers.google.com/accounts/docs/OAuth2InstalledApp) or\n[Using OAuth 2.0 for Server to Server Applications](https://developers.google.com/identity/protocols/OAuth2ServiceAccount). If you use an alternate workflow,\nspecify the following value as the `scope` parameter when you request an OAuth\n2.0 authorization code: \n\n`https://www.googleapis.com/auth/doubleclicksearch`\n\nIf you follow the server to server route, add the service account as a Search Ads 360 user.\n\nRecommended authorization workflow\n----------------------------------\n\n1. Go to the [Google API Console](https://console.cloud.google.com/) and select your project.\n\n\n If you haven't already created a Google API Console project and OAuth credentials, follow\n the instructions in [Create a Google API\n Console project and OAuth credentials for your client](/search-ads/v2/prereqs#project).\n\n To find your project's OAuth client ID and secret, do the following:\n 1. Open the [Credentials page](https://console.cloud.google.com/apis/credentials).\n 2. In the **Name** column, click the name of your OAuth client.\n 3. The client ID and secret are listed on the page.\n2. Open a web browser and [sign into Google](https://accounts.google.com/ServiceLogin)with a Google Account that [has\n permission to access data](/search-ads/v2/prereqs#permissions) in Search Ads 360.\n\n This is the Google Account your API client will use to authenticate with Search Ads 360.\n If the Google Account holder leaves your company and you remove Search Ads 360 access\n from the account, you will need to repeat this authorization workflow and specify a\n different Google Account.\n3. Obtain a refresh token by invoking the [Search Ads 360 utility script](/search-ads/v2/prereqs#ds3py) as follows:\n\n\n `sa360Api.py --login`\n\n\n The script takes you through the process of using the Oauth client ID and secret to\n obtain a refresh token. The refresh token is valid only for the Google Account you signed\n into during the previous step.\n\n As part of this process, the script generates a URL and instructs you to\n visit the URL in a web browser.\n4. When the browser asks you to allow OAuth client access to Search Ads 360 data,\n make sure the Google Account you signed into earlier appears. (If you're signed into multiple\n Google Accounts, you might be presented with a different account.)\n\n\n At the end of the process, the `sa360Api.py` script outputs a comma-delimited\n string. The first value is the client ID you provided, the second value is the client\n secret you provided, and the third value is the refresh token. In the following example\n output, the refresh token is in **bold text** : \n\n `123456789123.apps.googleusercontent.com,ABCDEFGHIJKLMNOPQR_abcdef,`**1/HIJklM01OPQR23NOP456rst890uvw**\n5. Store the client ID, client secret, and refresh token in a backend database or other secure location that's accessible to your application.\n Keep the entire comma-delimited string in a convenient location if you plan to use\n `sa360Api.py` to send sample JSON requests to the Search Ads 360 API. You'll pass the\n entire string as a parameter each time you invoke the script.\n\n6. Add code to your application that does the following:\n 1. Use the client ID, client secret, and refresh token to obtain a fresh OAuth 2.0 access token.\n 2. Send requests to the Search Ads 360 API using the fresh access token.\n\n\n If you're using the client libraries, the next section, [Set Up Your Application](/search-ads/v2/configure),\n describes how to add this authorization code to your application.\n\n\n If you're not using one of the client libraries, see [Using OAuth 2.0 for Installed Applications](https://developers.google.com/accounts/docs/OAuth2InstalledApp) for\n suggestions on obtaining a fresh access token."]]