हमारे प्रॉडक्ट के बारे में चर्चा करने और सुझाव देने के लिए, Google विज्ञापन और मेज़रमेंट कम्यूनिटी सर्वर में Google Ads के आधिकारिक Discord चैनल से जुड़ें.
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
इस गाइड में, सेवा खातों का इस्तेमाल करके, अपने क्रेडेंशियल का इस्तेमाल करके एपीआई ऐक्सेस के लिए OAuth2 को सेट अप करने का तरीका बताया गया है.
आपको यह तरीका सिर्फ़ एक बार अपनाना होगा. ऐसा तब तक करना होगा, जब तक आपने OAuth2 के क्रेडेंशियल रद्द या मिटा न दिए हों.
[null,null,["आखिरी बार 2025-08-27 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eThis guide explains how to set up OAuth2 for API access using service accounts, a one-time process unless credentials are changed.\u003c/p\u003e\n"],["\u003cp\u003eThe setup requires a Google Workspace domain and a service account with domain-wide delegation access granted by a super administrator.\u003c/p\u003e\n"],["\u003cp\u003eYou need to generate a service account ID and JSON file before configuring the client library.\u003c/p\u003e\n"],["\u003cp\u003eThe client library setup involves specifying the path to your JSON keyfile and the email address to impersonate within your \u003ccode\u003egoogle_ads_config.rb\u003c/code\u003e file.\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| **Note:** This flow requires a [Google Workspace](//workspace.google.com) domain and the service account that you created needs to be granted domain wide delegation access by a super administrator for the domain.\n\n[Generate a **service account ID and a \\*.JSON file**](/google-ads/api/docs/oauth/service-accounts#service_account_access_setup)\nby following the linked instructions, then come back to this page.\n\nSet up client library with JSON file\n------------------------------------\n\nConfigure the following keys in your [`google_ads_config.rb`](https://github.com/googleads/google-ads-ruby/blob/HEAD/google_ads_config.rb#L29). \n\n c.keyfile = 'path/to/keyfile.json'\n c.impersonate = 'INSERT_EMAIL_ADDRESS_TO_IMPERSONATE_HERE'"]]