Google Ads API에 관한 의견을 공유하고 싶으신가요?
등록하여 사용자 연구에 참여하도록 초대받으세요.
요청 헤더(선택사항)
요청 메서드에서 선택사항 필드를 사용하는 경우 요청 메시지는 메서드 외부에서 생성되고 단일 매개변수로 전달되어야 합니다.
선택적 요청 헤더(예: GoogleAdsService.Search
메서드의 validate_only
헤더)는 메서드 서명에 키워드 매개변수로 표시되지 않으므로 요청 메시지에서 직접 설정해야 합니다.
요청 객체 필드가 필수인지 선택사항인지 확인하려면 서비스의 protobuf 정의를 참조하고 주석 [(google.api.field_behavior) =
REQUIRED]
가 포함된 필드를 찾으면 됩니다.
다음은 GoogleAdsService.Search
요청에서 선택사항인 validate_only
필드를 설정하는 예입니다.
request = client.get_type("SearchGoogleAdsRequest")
request.customer_id = customer_id
request.query = query
request.validate_only = True
response = googleads_service.search(request=request)
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-03-04(UTC)
[null,null,["최종 업데이트: 2025-03-04(UTC)"],[[["When using optional fields in Google Ads API requests, construct the request message separately and pass it as a single parameter to the method."],["Optional request headers like `validate_only` are set directly on the request message, not as keyword parameters in the method signature."],["You can identify required or optional request fields by checking the protobuf definitions and looking for the `[(google.api.field_behavior) = REQUIRED]` annotation."],["To use optional fields, create an instance of the request message type, populate its fields including the optional ones, and then pass it to the API method."]]],[]]