Google Ads API의 REST 인터페이스를 사용할 경우 JSON 작업을 하게 됩니다.
Google Ads API의
.proto 설명자 파일). JSON 인코딩 스키마는
표준 인코딩 방식을
프로토콜의 JSON 매핑 섹션
언어 가이드를 버퍼링합니다.
일반적으로
서비스는 단일 JSON 객체입니다.
대부분의 뮤테이션 요청에는 자체적으로 여러 개의 operations 배열이 포함되어 있습니다.
create, update 또는 delete 연산. 마찬가지로 search 응답은
쿼리의 결과 집합이 있는 results 배열이 포함된 JSON 객체입니다.
식별자는 snake_case (프로토콜 버퍼 내)에서 다음으로 변환됩니다.
lowerCamelCase). 이 규칙에서 한 가지 주의할 점은
search 또는 searchStream: Google Ads 쿼리 언어 전송
쿼리합니다. 쿼리 언어 자체는
크게 다르지 않습니다 하지만 REST의 쿼리 결과는
일반적인 JSON 객체를 사용하고 식별자는 lowerCamelCase로 지정되어 있습니다.
예를 들어 계정의 활성 키워드 목록을 가져오는 쿼리는 다음을 사용합니다.
쿼리 자체 내에서 스네이크 표기법을 사용합니다 (adGroupCriterion가 아닌 ad_group_criterion).
POST /v17/customers/CUSTOMER_ID/googleAds:searchStream HTTP/1.1
Host: googleads.googleapis.com
Content-Type: application/json
Authorization: Bearer ACCESS_TOKEN
developer-token: DEVELOPER_TOKEN
{
"query": "SELECT ad_group_criterion.keyword.text
FROM ad_group_criterion
WHERE ad_group_criterion.type = 'KEYWORD'
AND ad_group_criterion.status = 'ENABLED'"
}
하지만 응답은 객체의 JSON 표현입니다 (JSON
이 요청에서 searchStream를 사용하므로 배열 중 하나)를 만들고 camelCase 식별자를 사용합니다.
대신 adGroupCriterion:
[[["이해하기 쉬움","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"]],["최종 업데이트: 2024-08-22(UTC)"],[[["The Google Ads API's REST interface uses JSON to represent resources and types, following the protocol buffers' JSON encoding scheme."],["Top-level messages in the REST interface are JSON objects, with mutate requests typically containing an `operations` array and search responses containing a `results` array."],["Identifiers are generally transformed from *snake_case* to *lowerCamelCase* in JSON, with the exception of Google Ads Query Language queries, which use snake case."],["While Google Ads Query Language queries use snake case, the results returned through the REST interface utilize *lowerCamelCase* for identifiers within the JSON response objects."]]],[]]