Google Business Performance API 的
NEW API 方法可擷取單一 API 要求中的多個「DailyMetrics」。
請詳閱
淘汰時間表和從 v4 reportInsights API 方法遷移至 Google Business Profile Performance API 的操作說明。
使用帳戶資料
本教學課程將說明如何使用帳戶資料。My Business Account Management API 可讓您執行下列操作:
事前準備
使用「我的商家帳戶管理」API 前,您必須先註冊應用程式並取得 OAuth 2.0 憑證。
如要進一步瞭解如何開始使用 Business Profile 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
類型的帳戶可以以這種方式更新。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-01-30 (世界標準時間)。
[null,null,["上次更新時間:2025-01-30 (世界標準時間)。"],[[["The My Business Account Management API allows you to manage business accounts, including listing all accounts, retrieving specific account details, and updating account names."],["Before using the API, you must register your application and obtain OAuth 2.0 credentials as outlined in the basic setup guide."],["You can retrieve a list of all accounts associated with an authenticated user or fetch details for a specific account using dedicated API endpoints."],["Updating an account is restricted to changing the account name for business type accounts only, with other fields being ignored."]]],[]]