使用账号数据
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本教程介绍了如何使用账号数据。借助 My Business Account Management API,您可以执行以下操作:
准备工作
在使用 My Business Account Management 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
类型的账号才能采用这种方式进行更新。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-12-05。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-12-05。"],[[["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."]]],[]]