با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
این راهنما نحوه راهاندازی OAuth2 برای دسترسی API را با استفاده از اعتبارنامههای خود با استفاده از حسابهای سرویس به شما آموزش میدهد. این مراحل فقط یک بار باید انجام شوند، مگر اینکه اعتبارنامه OAuth2 خود را لغو یا حذف کنید.
تاریخ آخرین بهروزرسانی 2025-08-26 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-26 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThis guide explains how to set up OAuth2 for Google Ads API access using service accounts with your own credentials.\u003c/p\u003e\n"],["\u003cp\u003eYou'll need a Google Workspace domain and a service account with domain-wide delegation access granted by a super administrator.\u003c/p\u003e\n"],["\u003cp\u003eSetup involves generating a service account ID and JSON file, then configuring your client library with the file's path, scopes, and impersonated email.\u003c/p\u003e\n"]]],[],null,["# OAuth Service Account Flow\n\nThis guide will walk you through how to set up 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\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 with JSON file\n------------------------------------\n\nConfigure the following keys in your `google_ads_php.ini`. See the\n[configuration guide](/google-ads/api/docs/client-libs/php/configuration) for additional\ndetails. \n\n ; For service account flow.\n jsonKeyFilePath = \"path/to/your/oauth2/key/file.json\"\n scopes = \"https://www.googleapis.com/auth/adwords\"\n impersonatedEmail = \"impersonated.account@email.com\""]]