안내 가이드
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 페이지에서는 API를 사용하여 일반적인 작업을 수행하는 방법을 자세히 설명합니다.
사용자 만들기
UserService는
생성할 수 있는 관리자 권한이 있는 사용자는
네트워크에 직접 연결할 수 있습니다. 개발자라면 누구나 이 작업을 수행할 수 있는
신규 사용자가 먼저 가입하도록 해야 합니다 예를 들어,
관리자 자격으로 모든 API 호출을 수행하는 대신 (기본 설정)
이메일 주소에 대한 설명)
실제 워크플로를 테스트할 영업 담당자, 애드 마스터 또는 광고주
- 새 Gmail 주소(예:
my.name.salesperson@gmail.com
)를 만듭니다. 이와 달리
Gmail이 아닌 기존 주소를 새 이메일 주소로 등록
Google 계정에 로그인합니다.
- 새 주소와 선택된
Role
로 createUsers
를 호출합니다.
- 액세스 토큰을 생성하려면 OAuth 2.0을 사용하여 새 사용자로 인증할 수 있습니다.
루트 AdUnit 가져오기
하위 노드를 추가할 수 있는 최상위 AdUnit
와 계층 구조의 허용되는 깊이는 모두 계정 유형 (Small Business 또는 Premium)에 따라 다릅니다. 하위 노드의 수정을 지원하는 최상위 AdUnit
를 유효 루트 AdUnit
라고 합니다.
유효 루트를 가져오려면 NetworkService.getCurrentNetwork()
를 호출하고 반환된 Network
객체에서 effectiveRootAdUnitId
필드를 확인합니다.
참고: 계정 유형에 따라 지원되는 계층 구조 패턴이 다릅니다.
객체 쿼리
getObjectsByStatement()
메서드를 사용하여 검색 기준으로 객체를 검색합니다.
많은 서비스에서 노출됩니다. 여기서 Object는 특정 객체 유형입니다. 이
메서드는 PQL 쿼리를 사용합니다. PQL 쿼리는
검색할 필드 (필드 이름이 객체의 속성에 매핑되는 위치), 정렬,
검색 결과를 제한하고 상쇄할 수 있습니다. PQL 참조
가이드: PQL에 대해 자세히 알아보고 어떤 객체 필드를 사용할 수 있는지 알아보세요.
필터를 적용합니다.
주문 만들기
주문을 만들려면 Order
객체를 만들고 광고주를 설정하기만 하면 됩니다.
적절한 사용자에게 고유한 이름을 할당하고
그리고 createOrders()
를 호출합니다. 결과에는 새로 만든 Order
,
오류가 있을 수 있습니다.
예
주문 생성을 위한 자바 코드 예를 참고하세요.
광고 항목 만들기
새 광고 항목을 만드는 단계는 다음과 같습니다.
- 새
Order
객체를 만들거나 기존 객체를 사용합니다.
- 새
LineItem
객체를 만들고 순환게재 유형, 광고 소재 크기 배열,
시작일, 종료일, 기타 속성을 설정할 수 있습니다.
- 새
InventoryTargeting
객체를 만들고 타겟팅하거나 제외할 Placement
또는 AdUnit
객체를 지정합니다.
InventoryTargeting
객체를 새 Targeting
객체 내에 래핑하고
LineItem
의 타겟팅 속성에 추가합니다.
- 새 객체로 lineitem 서비스 메서드
createLineItems()
를 호출하고 결과를 검토하여 객체가 생성되었는지 확인합니다.
예
광고 항목을 생성하기 위한 자바 코드의 예를 참조하세요.
광고 소재 만들기
광고 소재 유형이 다르면 지원되는 구성요소도 다릅니다(예: 이미지
광고 소재는 이미지의 단일 소스 파일을 지원합니다. 플래시 광고 소재는
두 개의 기본 자산 파일: 플래시 파일과 백업 이미지 파일(플래시가 존재하는 경우)
파일을 게재할 수 없습니다. 타사 사이트에 호스팅된 광고 소재의 경우
제3자 서버의 파일을 참조하는 HTML 스니펫만 반환합니다. 다음을 확인하세요.
순서대로 업로드해야 하는 애셋을 알 수 있는 특정 Creative
서브클래스
광고 소재를 만듭니다.
예
이미지 광고 소재를 만들기 위한 자바 코드의 예를 참조하세요.
기존 객체 수정
기존 객체를 수정하려면 getObjectsByStatement()
를 호출하여 객체를 쿼리합니다.
반환된 객체의 값을 업데이트한 다음 updateObjects()
를 호출합니다.
참고: 업데이트된 객체는 기존 객체를 완전히 대체하므로
보내는 객체에서 속성 값을 설정하지 않으면 저장된 객체는
이전 값이 아닌 해당 속성의 기본값을 가져옵니다.
객체 상태 변경
performObjectAction()
메서드를 호출하여 객체 상태가 변경됨
서비스에 의해 노출됩니다 이 메서드는 다음과 같은 두 개의 매개변수를 사용합니다.
- 실행하려는 작업을 설명하는 작업 객체의 인스턴스입니다. 대상
인스턴스, 주문 서비스는
ApproveOrders
, PauseOrders
,
및 ArchiveOrders
모든 작업 객체는 기본 작업에서 파생됨
클래스에 적합한 API를 제공합니다.
- 변경할 객체를 설명하는 PQL 쿼리 변경할 수 있습니다.
적절한 PQL을 지정하여 한 번에 하나 이상의 객체의 상태
구문
API를 사용하여 광고 태그를 생성할 수 없습니다. Google Ad Manager 웹사이트를 사용해야 합니다. 자세한 내용은 태그 지정
고객센터 섹션에서
자세히 알아보세요.
예시 더보기
클라이언트 라이브러리 샘플 코드,
사용할 수 있습니다. 자세한 내용은 클라이언트 라이브러리 및 예시 코드
페이지를 참조하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-21(UTC)
[null,null,["최종 업데이트: 2025-08-21(UTC)"],[[["\u003cp\u003eThis API allows administrators to create and manage users, orders, line items, and creatives directly within their network.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use PQL queries to search and filter objects, similar to SQL, and modify existing objects through updates.\u003c/p\u003e\n"],["\u003cp\u003eDifferent creative types require specific assets; consult the relevant subclass documentation for details.\u003c/p\u003e\n"],["\u003cp\u003eAd tag generation is not supported by the API; use the Google Ad Manager website for this function.\u003c/p\u003e\n"],["\u003cp\u003eAccess further code samples and resources on the Client Libraries & Example Code page.\u003c/p\u003e\n"]]],["The API facilitates several core actions: creating users via `createUsers` with specified roles, and retrieving the effective root AdUnit using `NetworkService.getCurrentNetwork()`. Objects are queried using `get*Objects*ByStatement()`, and orders are created via `createOrders()`. Line items require order creation, then crafting `LineItem`, `InventoryTargeting`, and `Targeting` objects before utilizing `createLineItems()`. Creatives are created with the necessary asset uploads, while object modification involves querying, updating, and using `update*Objects*()`. Object status is changed with the `perform*Object*Action()` method. Ad tags are generated via the Google Ad Manager website.\n"],null,["# How To Guide\n\nThis page provides details on how to perform common tasks using the API.\n\nCreating Users\n--------------\n\nThe [UserService](/ad-manager/api/reference/latest/UserService) allows\na user with Administrator rights to [create\na user](/ad-manager/api/reference/latest/UserService#createUser) directly in their network. Any developer can do this without\nhaving the new user sign up first. For example, if you are trying out the API for\nthe first time, instead of performing every API call as an Administrator (the default\nfor your email address), you may want to create a few users with roles such as\nSalesperson, Trafficker, or Advertiser to test real-world workflows.\n\n1. Create some new gmail addresses such as `my.name.salesperson@gmail.com`. Alternatively, register an existing non-gmail address as a [new\n Google account](http://www.google.com/accounts/NewAccount).\n2. Call `createUsers` with that new address and the chosen [Role](/ad-manager/api/reference/latest/UserService.Role).\n3. You can authenticate as that new user, using [OAuth 2.0](/ad-manager/api/authentication) to generate your access token.\n\nGetting the Root AdUnit\n-----------------------\n\nBoth the topmost `AdUnit` to which you can add child nodes and the permitted depth of your hierarchy depend on your account type (Small Business or Premium). The topmost `AdUnit` that supports modifying its child nodes is called the effective root `AdUnit`.\n\nTo retrieve the effective root, call [NetworkService.getCurrentNetwork()](/ad-manager/api/reference/latest/NetworkService#getCurrentNetwork), and examine the `effectiveRootAdUnitId` field on the returned [Network](/ad-manager/api/reference/latest/NetworkService.Network) object.\n\n**Note:** Different account types support different hierarchy patterns.\n\nQuerying for an Object\n----------------------\n\nYou search for objects by search criteria using the `get`*Objects*`ByStatement()` method\nexposed by many services, where *Object* is a specific object type. This\nmethod takes a PQL query, which is similar to a SQL query in that it lets you specify\nfields to search on (where field names map to properties on the object), sort,\nlimit, and offset your search results. See the [PQL\nGuide](/ad-manager/api/pqlreference) to learn more about PQL, and also to learn which object fields you can\nfilter by.\n\nCreating an Order\n-----------------\n\nTo create an order, simply create an `Order` object and set the advertiser,\nsalesperson, and trafficker IDs to the appropriate users, assign a unique name,\nand call `createOrders()`. The result will include the newly created `Order`,\nor an error.\n\n**Example**\n\nSee example [Java code for creating an order](https://github.com/googleads/googleads-java-lib/blob/main/examples/admanager_axis/src/main/java/admanager/axis/v202508/orderservice/CreateOrders.java).\n\nCreating a Line Item\n--------------------\n\nHere are the steps for creating a new line item:\n\n1. Create a new `Order` object or use an existing one.\n2. Create a new `LineItem` object, and set the rotation type, creative size array, start and end dates, and other properties.\n3. Create a new `InventoryTargeting` object, and specify which `Placement` or `AdUnit` objects to target or exclude.\n4. Wrap your `InventoryTargeting` object inside a new `Targeting` object, and assign it to your `LineItem`'s targeting property.\n5. Call the lineitem service method `createLineItems()` with your new object, and examine the result to see whether your object was created.\n\n**Example**\n\nSee example [Java code for creating a line item](https://github.com/googleads/googleads-java-lib/blob/main/examples/admanager_axis/src/main/java/admanager/axis/v202508/lineitemservice/CreateLineItems.java).\n\nCreating a Creative\n-------------------\n\nDifferent types of creatives support different components: for example, an image\ncreative supports a single source file for the image; a flash creative supports\ntwo underlying asset files: a flash file and a backup image file, in case the flash\nfile cannot be served. For creatives hosted on third-party sites, you will upload\nonly an HTML snippet that references the file on the third-party server. See your\nspecific `Creative` subclass to learn what assets you'll have to upload in order\nto create your creative.\n\n**Example**\n\nSee example [Java code for creating an image creative](https://github.com/googleads/googleads-java-lib/blob/main/examples/admanager_axis/src/main/java/admanager/axis/v202508/creativeservice/CreateCreatives.java).\n\nModifying an Existing Object\n----------------------------\n\nTo modify an existing object, query for your object by calling `get`*Objects*`ByStatement()`,\nupdate the values in the returned objects, and then call `update`*Objects*`()`.\n\n**Note:** Updated objects will completely replace existing objects, so if you\nneglect to set a property value in the object that you send, the saved object will\nget the default value for that property, not the previous value.\n\nChanging Object Status\n----------------------\n\nObject status is changed by calling the `perform`*Object*`Action()` method\nexposed by your service. This method takes two parameters:\n\n- **An instance of the action object that describes what you want done.** For instance, the order service exposes several actions including `ApproveOrders`, `PauseOrders`, and `ArchiveOrders`. Action objects all derive from a base action class appropriate for your service.\n- **A PQL query describing which objects to change.** You can change the status of one or more objects at a time by specifying an appropriate PQL statement.\n\nGenerating Ad Tags\n------------------\n\nYou cannot generate ad tags using the API; instead you must use the Google Ad Manager website. See the [Tagging](https://support.google.com/admanager/answer/177207) Help Center section for\nmore information.\n\nMore Examples\n-------------\n\nYou can find many more examples in our client library sample code, in several\ndifferent programming languages. See the [Client Libraries \\& Example Code](/ad-manager/api/clients) page for a link to examples in your programming language."]]