احتیاط: شما در حال مشاهده اسناد رابط REST API هستید. اکثر کتابخانه های مشتری رسمی ما از gRPC استفاده می کنند. برای جزئیات بیشتر به
مقدمه REST مراجعه کنید.
روش های خدمات
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
طراحی Google Ads API با معماری سنتی REST متفاوت است زیرا در اصل از روشهای سفارشی مانند search
و mutate,
به جای list
سنتیتر، روشهای get
، create
، update
و delete
. این اقدامات در URL های REST با استفاده از قرارداد نگاشت HTTP a :
برای جدا کردن فعل سفارشی از بقیه URL بیان می شوند.
به عنوان مثال، یک تماس API جهش یافته کمپین از URL زیر استفاده می کند:
https://googleads.googleapis.com/v21/customers/1234567890/campaigns:mutate
یکی از دلایلی که API از روشهای سفارشی استفاده میکند، فعال کردن دستهبندی چندین عملیات در یک درخواست API است. معنای دقیق REST فقط به روز رسانی یک کمپین را در هر زمان امکان پذیر می کند. برای مثال، یک update
سنتی REST برای یک کمپین، به ارسال یک درخواست HTTP PATCH برای هر منبع کمپین نیاز دارد.
برای اینکه بسیاری از عملیاتها در یک بدنه درخواستی با هم جمع شوند، Google Ads API در عوض یک روش mutate
سفارشی را برای بیشتر منابع تعریف میکند. به طور مشابه، برای فعال کردن خواندن دستهای (واکشی همزمان بسیاری از اشیاء) از API، API از یک روش search
سفارشی با زبان جستجوی Google Ads مانند SQL استفاده میکند.
صفحه روشهای متداول به جزئیات بیشتر روشهای مورد استفاده در Google Ads API میپردازد.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-26 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-26 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThe Google Ads API utilizes custom methods like \u003ccode\u003esearch\u003c/code\u003e and \u003ccode\u003emutate\u003c/code\u003e instead of standard REST methods for efficiency and batch operations.\u003c/p\u003e\n"],["\u003cp\u003eThis approach allows for updating multiple campaigns or fetching numerous objects within a single request, unlike traditional REST.\u003c/p\u003e\n"],["\u003cp\u003eCustom methods are expressed in REST URLs using a colon to separate the verb from the rest of the URL, for example, \u003ccode\u003ehttps://googleads.googleapis.com/v18/customers/1234567890/campaigns:mutate\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eBatching operations, like updating many campaigns simultaneously, are enabled through the custom \u003ccode\u003emutate\u003c/code\u003e method, improving efficiency over individual requests.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003esearch\u003c/code\u003e method uses a SQL-like query language for batch reads, enabling retrieval of multiple objects in one API call.\u003c/p\u003e\n"]]],["The Google Ads API uses custom methods like `search` and `mutate` instead of standard REST methods (e.g., `list`, `get`). This is indicated in URLs by a `:` separator. `Mutate` enables batching multiple operations into one request, unlike standard `update`, which handles one campaign at a time. Similarly, `search` allows fetching multiple objects in a single request, utilizing a SQL-like query language. This deviates from REST conventions to facilitate efficient batch processing and querying.\n"],null,["# Service Methods\n\nThe design of the Google Ads API differs from a traditional REST architecture\nbecause it primarily uses custom methods, such as `search` and `mutate,` instead\nof the more traditional `list`, `get`, `create`, `update`, and `delete` methods.\nThese actions are expressed in REST URLs by using the [HTTP mapping](https://cloud.google.com/apis/design/custom_methods#http_mapping)\nconvention of a `:` to separate the custom verb from the rest of the URL.\n\nFor example, a campaign mutate API call uses the following URL: \n\n https://googleads.googleapis.com/v21/customers/1234567890/campaigns:mutate\n\nOne reason that the API uses custom methods is to enable batching of multiple\noperations into a single API request. Strict REST semantics would only allow\nupdating one campaign at a time. A traditional REST\n[`update`](https://cloud.google.com/apis/design/standard_methods#update) to a\ncampaign, for example, would require sending one HTTP PATCH request per campaign\nresource.\n\nTo allow many operations to be bundled together within a single request body,\nthe Google Ads API instead defines a custom `mutate` method for most resources.\nSimilarly, to enable batch reads (fetching many objects at once) from the API,\nthe API uses a custom `search` method with a SQL-like [Google Ads Query\nLanguage](/google-ads/api/docs/query/overview).\n\nThe [Common methods](/google-ads/api/rest/common/overview) page goes into detail on\nthe most frequently used methods in the Google Ads API."]]