Google Business Performance API มีเมธอด API
ใหม่ที่อนุญาตให้ดึง `DailyMetrics` หลายรายการในคําขอ API รายการเดียว
ตรวจสอบ
กําหนดการเลิกใช้งานและวิธีการย้ายข้อมูลจากเมธอด v4 reportInsights API ไปยัง API ประสิทธิภาพของ Google Business Profile
ทำงานกับข้อมูลบัญชี
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
บทแนะนำนี้จะแสดงวิธีจัดการข้อมูลบัญชี 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 Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-29 UTC
[null,null,["อัปเดตล่าสุด 2025-08-29 UTC"],[[["\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."]]