Google Business Performance API یک روش API
جدید دارد که امکان واکشی چندین «DailyMetrics» را در یک درخواست API فراهم میکند.
زمانبندی منسوخ شدن و دستورالعملهای انتقال از روش API reportInsights v4 به API عملکرد نمایه کسبوکار Google را مرور کنید.
با داده های حساب کار کنید
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
این آموزش نحوه کار با داده های حساب را به شما نشان می دهد. My Business Account Management API این توانایی را در اختیار شما قرار می دهد که کارهای زیر را انجام دهید:
- لیست همه حساب ها
- یک حساب خاص را برگردانید.
- یک حساب کاربری را به روز کنید.
قبل از شروع
قبل از استفاده از My Business Account Management API، باید برنامه خود را ثبت کنید و اعتبارنامه OAuth 2.0 را دریافت کنید.
برای جزئیات در مورد نحوه شروع به کار با APIهای نمایه کسب و کار، به تنظیمات اولیه مراجعه کنید.
لیست همه حساب ها
یک راه عالی برای تأیید اعتبار حساب های مرتبط با یک کاربر تأیید شده، فهرست کردن همه حساب های آنها است. از accounts.list
API برای فهرست کردن تمام حساب های مرتبط با یک کاربر استفاده کنید.
برای فهرست کردن تمام حسابهای کاربری احراز هویت شده، از موارد زیر استفاده کنید:
$ GET https://mybusinessaccountmanagement.googleapis.com/v1/accounts
یک حساب خاص را برگردانید
گاهی اوقات، شما فقط می خواهید اطلاعات مربوط به یک حساب کاربری خاص را برای یک کاربر احراز هویت شده ببینید. از accounts.get
API برای بازگرداندن یک حساب خاص و بررسی جزئیات بیشتر حساب استفاده کنید.
برای بازگرداندن یک حساب خاص با نام، از موارد زیر استفاده کنید:
$ GET https://mybusinessaccountmanagement.googleapis.com/v1/accounts/{accountId}
یک حساب کاربری را به روز کنید
تغییر نام حساب یک کار اداری اساسی است. برای تغییر نام حساب از accounts.update
API استفاده کنید.
برای به روز رسانی یک حساب خاص با نام، از موارد زیر استفاده کنید:
$ PUT https://mybusinessaccountmanagement.googleapis.com/v1/accounts/{accountId}
{
"account": {
"accountName": "Anne Droyd"
},
"languageCode": "en",
"validateOnly": "true"
}
محدودیت ها
- تنها فیلد قابل ویرایش برای یک حساب،
accountName
است. هر فیلد دیگری که رد شده است نادیده گرفته می شود. - فقط حساب های از نوع
BUSINESS
را می توان به این روش به روز کرد.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThe My Business Account Management API allows you to manage business accounts, including listing all accounts, retrieving specific account details, and updating account names.\u003c/p\u003e\n"],["\u003cp\u003eBefore using the API, you must register your application and obtain OAuth 2.0 credentials as outlined in the basic setup guide.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve a list of all accounts associated with an authenticated user or fetch details for a specific account using dedicated API endpoints.\u003c/p\u003e\n"],["\u003cp\u003eUpdating an account is restricted to changing the account name for business type accounts only, with other fields being ignored.\u003c/p\u003e\n"]]],[],null,["# Work with account data\n\n\u003cbr /\u003e\n\nThis tutorial shows you how to work with account data. The My Business Account Management API\nprovides you with the ability to do the following:\n\n- List all accounts.\n- Return a specific account.\n- Update an account.\n\nBefore you begin\n----------------\n\nBefore you use the My Business Account Management API, you need to register your application\nand obtain OAuth 2.0 credentials.\n\nFor details on how to get started with the Business Profile APIs, see\n[Basic setup](/my-business/content/basic-setup).\n\nList all accounts\n-----------------\n\nA great way to validate the accounts associated with an authenticated user is to\nlist all their accounts. Use the [`accounts.list`](/my-business/reference/accountmanagement/rest/v1/accounts/list)\nAPI to list all accounts associated with a user.\n\nTo list all the accounts for an authenticated user, use the following:\nHTTP \n\n```bash\n$ GET https://mybusinessaccountmanagement.googleapis.com/v1/accounts\n```\n\nReturn a specific account\n-------------------------\n\nSometimes, you only want to see information about a specific account for an\nauthenticated user. Use the [`accounts.get`](/my-business/reference/accountmanagement/rest/v1/accounts/get)\nAPI to return a specific account and review additional account details.\n\nTo return a specific account by name, use the following:\nHTTP \n\n```bash\n$ GET https://mybusinessaccountmanagement.googleapis.com/v1/accounts/{accountId}\n```\n\nUpdate an account\n-----------------\n\nChanging an account name is a fundamental administrative task. Use the\n[`accounts.update`](/my-business/reference/accountmanagement/rest/v1/accounts/patch) API to alter\nthe account name.\n\nTo update a specific account by name, use the following:\nHTTP \n\n```bash\n$ PUT https://mybusinessaccountmanagement.googleapis.com/v1/accounts/{accountId}\n\n{\n \"account\": {\n \"accountName\": \"Anne Droyd\"\n },\n \"languageCode\": \"en\",\n \"validateOnly\": \"true\"\n}\n```\n\n### Restrictions\n\n- The only editable field for an account is `accountName`. Any other fields passed are ignored.\n- Only accounts of `BUSINESS` type can be updated in this manner."]]