أصبحت Search Ads 360 Reporting API الجديدة متاحة الآن. يمكنك الانضمام إلى مجموعة Google
searchads-api-announcements لتبقى على اطّلاع على التحسينات والإصدارات القادمة.
تهيئة مكتبة عميل جافا
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تبحث المكتبة عن ملف إعداد في
System.getProperty("user.home") + "/searchads360.properties"
.
يكون تنسيق ملف الإعداد على شكل ملف Properties من Java يحتوي على أزواج المفاتيح والقيم. تختلف المفاتيح المتوافقة حسب مسار المصادقة الذي تم اختياره.
المفاتيح المتوافقة مع مسارات تطبيقات الكمبيوتر المكتبي والويب
إذا كنت تستخدم مسار تطبيق الكمبيوتر المكتبي أو الويب، تكون المفاتيح المتوافقة كما يلي:
# Credential for accessing Google's OAuth servers.
# Provided by console.cloud.google.com.
api.searchads360.clientId=INSERT_CLIENT_ID_HERE
# Credential for accessing Google's OAuth servers.
# Provided by console.cloud.google.com.
api.searchads360.clientSecret=INSERT_CLIENT_SECRET_HERE
# Renewable OAuth credential associated with 1 or more Search Ads accounts.
api.searchads360.refreshToken=INSERT_REFRESH_TOKEN_HERE
# Required for manager accounts only: Specify the login customer ID used to
# authenticate API calls. This will be the customer ID of the authenticated
# manager account. You can also specify this later in code if your application
# uses multiple manager account + OAuth pairs.
#
# api.searchads360.loginCustomerId=INSERT_LOGIN_CUSTOMER_ID_HERE
الجمع بين طرق الإعداد
تتيح السمة SearchAds360Client
وأداة الإنشاء الخاصة بها إمكانية الجمع بين استراتيجيات إعدادات مختلفة. على سبيل المثال، يمكنك استخدام ملف خصائص لضبط بيانات اعتماد المثيل وسمات أخرى باستخدام المقتطف التالي.
SearchAds360Client searchAds360Client = SearchAds360Client.newBuilder()
.fromPropertiesFile()
.build();
يمكنك إجراء المزيد من التغييرات في وقت التشغيل باستخدام طرق الضبط الأخرى الخاصة بأداة الإنشاء قبل استدعاء build()
.
إذا كنت بصدد إثبات الهوية كحساب إداري، عليك أيضًا تحديد ما يلي:
api.searchads360.loginCustomerId --> Manager account ID (with hyphens removed).
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-09-03 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-09-03 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eThe Search Ads 360 API uses a configuration file located at \u003ccode\u003eSystem.getProperty("user.home") + "/searchads360.properties"\u003c/code\u003e to store essential settings like client ID, client secret, and refresh token.\u003c/p\u003e\n"],["\u003cp\u003eThis configuration file follows the Java Properties file format and supports different keys based on the authentication method, such as desktop, web, or service application flows.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can combine configuration approaches, using the properties file for credentials and then further customizing the client using builder methods.\u003c/p\u003e\n"],["\u003cp\u003eWhen authenticating as a manager account, you need to specify the \u003ccode\u003eapi.searchads360.loginCustomerId\u003c/code\u003e in the configuration file or during client initialization.\u003c/p\u003e\n"],["\u003cp\u003eOAuth refresh tokens required for authentication can be generated using the provided user credential generation script or the OAuth Playground utility.\u003c/p\u003e\n"]]],["The library utilizes a configuration file located at `user.home/searchads360.properties`, formatted as key-value pairs. For desktop/web flows, required keys include `api.searchads360.clientId`, `api.searchads360.clientSecret`, and `api.searchads360.refreshToken`. Manager accounts also need `api.searchads360.loginCustomerId`. An OAuth refresh token can be generated via a provided script or the OAuth Playground. Configurations can be combined using the `SearchAds360Client` builder, which allows file-based configuration and runtime modifications.\n"],null,["# Java client library configuration\n\nThe library looks for a configuration file in\n`System.getProperty(\"user.home\") + \"/searchads360.properties\"`.\n\nThe format of the configuration file is that of a Java\n[Properties](//docs.oracle.com/javase/tutorial/essential/environment/properties.html)\nfile of key value pairs. The supported keys vary depending on the chosen\nauthentication flow.\n\nSupported keys for desktop and web application flows\n----------------------------------------------------\n\nIf you are using the [desktop or web](/search-ads/reporting/quickstart/quickstart-guide#create_oauth2_credentials) application flow, the supported keys\nare as follows: \n\n # Credential for accessing Google's OAuth servers.\n # Provided by console.cloud.google.com.\n api.searchads360.clientId=INSERT_CLIENT_ID_HERE\n\n # Credential for accessing Google's OAuth servers.\n # Provided by console.cloud.google.com.\n api.searchads360.clientSecret=INSERT_CLIENT_SECRET_HERE\n\n # Renewable OAuth credential associated with 1 or more Search Ads accounts.\n api.searchads360.refreshToken=INSERT_REFRESH_TOKEN_HERE\n\n # Required for manager accounts only: Specify the login customer ID used to\n # authenticate API calls. This will be the customer ID of the authenticated\n # manager account. You can also specify this later in code if your application\n # uses multiple manager account + OAuth pairs.\n #\n # api.searchads360.loginCustomerId=INSERT_LOGIN_CUSTOMER_ID_HERE\n\n\n| **Note:** You can generate an OAuth refresh token by running the provided [user credential generation script](/search-ads/reporting/sample-code/generate-user-credentials) or by using the [OAuth Playground](/search-ads/reporting/concepts/oauth-playground) utility.\n\nCombining configuration approaches\n----------------------------------\n\nThe `SearchAds360Client` and its builder support combining different configuration\nstrategies. For example, you can use a properties file to configure the\ncredentials of the instance and for other attributes using\nthe following snippet. \n\n SearchAds360Client searchAds360Client = SearchAds360Client.newBuilder()\n .fromPropertiesFile()\n .build();\n\nYou can make further changes at runtime using the builder's other configuration\nmethods before calling `build()`.\n\nIf you are authenticating as a manager account, additionally you must\nspecify: \n\n api.searchads360.loginCustomerId --\u003e Manager account ID (with hyphens removed)."]]