OAuth सेवा खाते का फ़्लो
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
इस गाइड में, सेवा खातों का इस्तेमाल करके, अपने क्रेडेंशियल का इस्तेमाल करके एपीआई ऐक्सेस के लिए OAuth2 को सेट अप करने का तरीका बताया गया है.
आपको यह तरीका सिर्फ़ एक बार अपनाना होगा. ऐसा तब तक करना होगा, जब तक आपने OAuth2 के क्रेडेंशियल रद्द या मिटा न दिए हों.
OAuth2 क्रेडेंशियल बनाना
लिंक किए गए निर्देशों का पालन करके, सेवा खाते का आईडी और *.JSON फ़ाइल जनरेट करें. इसके बाद, इस पेज पर वापस आएं.
क्लाइंट लाइब्रेरी सेट अप करना
अपने कॉन्फ़िगरेशन में निजी कुंजी का JSON पाथ सेट करें. अगर किसी दूसरे व्यक्ति के नाम पर पुष्टि की जा रही है, तो उपयोगकर्ता को किसी दूसरे व्यक्ति के नाम पर पुष्टि करने के लिए भी सेट करें.
अगर ads.properties
फ़ाइल का इस्तेमाल किया जा रहा है, तो ये जोड़ें:
api.googleads.serviceAccountSecretsPath=PRIVATE_KEY_FILE_PATH
# Only add this key if you are using impersonation.
api.googleads.serviceAccountUser=USER_TO_IMPERSONATE
ज़्यादा जानकारी के लिए, कॉन्फ़िगरेशन गाइड देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-27 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-27 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eThis guide explains how to set up OAuth2 for API access using service accounts with your own credentials.\u003c/p\u003e\n"],["\u003cp\u003eThe setup process involves generating a service account ID and a JSON file, and then configuring your client library with the necessary credentials.\u003c/p\u003e\n"],["\u003cp\u003eThis setup needs to be done only once and requires a Google Workspace domain with domain-wide delegation access granted to the service account.\u003c/p\u003e\n"]]],[],null,["# OAuth Service Account Flow\n\nThis guide will walk you through how to setup OAuth2 for API access using your\nown credentials using [service accounts](/google-ads/api/docs/oauth/service-accounts).\nThese steps only need to be done once, unless you revoke or delete your OAuth2\ncredentials.\n\nCreate OAuth2 credentials\n-------------------------\n\n[Generate a **service account ID and a \\*.JSON\nfile**](/google-ads/api/docs/oauth/service-accounts#service_account_access_setup) by\nfollowing the linked instructions, then come back to this page.\n\nSet up client library\n---------------------\n\nSet the private key JSON path in your configuration. If you're [authenticating\nusing impersonation](/google-ads/api/docs/oauth/service-accounts#impersonation), also set the\nuser to impersonate.\n\nIf you're using an `ads.properties` file, add the following: \n\n api.googleads.serviceAccountSecretsPath=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-s\"\u003ePRIVATE_KEY_FILE_PATH\u003c/span\u003e\u003c/var\u003e\n # Only add this key if you are using impersonation.\n api.googleads.serviceAccountUser=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-s\"\u003eUSER_TO_IMPERSONATE\u003c/span\u003e\u003c/var\u003e\n\nSee the [configuration guide](/google-ads/api/docs/client-libs/java/config-file) for\nadditional details."]]