단일 액세스 토큰으로 여러 API에 다양한 수준의 액세스 권한을 부여할 수 있습니다. scope라는 변수 매개변수는 액세스 토큰이 허용하는 리소스 및 작업 집합을 제어합니다. 액세스 토큰 요청 중에 앱은 scope 매개변수에 하나 이상의 값을 전송합니다.
Google Ads API의 범위는 다음과 같습니다.
https://www.googleapis.com/auth/adwords
오프라인 액세스
Google Ads API 클라이언트 앱은 일반적으로 오프라인 액세스를 요청합니다. 예를 들어 사용자가 웹사이트를 탐색하며 실제로 온라인 상태가 아닐 때 앱에서 일괄 작업을 실행할 수 있습니다.
웹 앱 유형에 대해 오프라인 액세스를 요청하려면 access_type 매개변수를 offline로 설정해야 합니다. 자세한 내용은 Google의 OAuth2 가이드를 참고하세요.
데스크톱 앱 유형의 경우 오프라인 액세스가 기본적으로 사용 설정되므로 명시적으로 요청할 필요가 없습니다.
요청 헤더
gRPC 헤더
gRPC API를 사용할 때는 각 요청에 액세스 토큰을 포함합니다. Credential를 Channel에 바인딩하여 해당 채널의 모든 요청에 사용할 수 있습니다. 호출마다 맞춤 인증 정보를 전송할 수도 있습니다. gRPC 승인 가이드에서 승인 처리에 관한 자세한 내용을 확인하세요.
REST 헤더
REST API를 사용할 때는 HTTP 헤더 Authorization를 통해 액세스 토큰을 전달합니다. HTTP 요청 예는 다음과 같습니다.
액세스 토큰에는 만료 시간이 있으며 (expires_in 값에 따라 다름) 이 시간이 지나면 토큰이 더 이상 유효하지 않습니다. 갱신 토큰을 사용하여 만료된 액세스 토큰을 갱신할 수 있습니다. 기본적으로 클라이언트 라이브러리는 만료된 액세스 토큰을 자동으로 새로고침합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-03-12(UTC)"],[[["This guide is for advanced users familiar with OAuth 2.0 and its use with Google APIs, offering behind-the-scenes details on authentication with the Google Ads API."],["Access tokens control API access, determined by the 'scope' parameter, with the Google Ads API scope being `https://www.googleapis.com/auth/adwords`."],["Offline access is available for client apps; web apps require setting `access_type` to `offline`, while desktop apps have it enabled by default."],["Access tokens are passed via the `Authorization` HTTP header for REST or bound to a `Channel` for gRPC, and can be refreshed using a securely stored refresh token."],["Client libraries automatically handle token refresh, but developers can consult guides for desktop and web app token management."]]],[]]