Method: accounts.create
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tạo một tài khoản có tên và loại đã chỉ định trong thành phần mẹ đã cho.
- Bạn không thể tạo tài khoản cá nhân và tổ chức.
- Không thể tạo Nhóm người dùng bằng tài khoản Cá nhân làm chủ sở hữu chính.
- Bạn không thể tạo Nhóm địa điểm thông qua chủ sở hữu chính của tài khoản Cá nhân nếu tài khoản Cá nhân đó nằm trong một Tổ chức.
- Nhóm vị trí không thể sở hữu Nhóm vị trí.
Yêu cầu HTTP
POST https://mybusiness.googleapis.com/v4/accounts
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số truy vấn
Các tham số |
primaryOwner |
string
Tên tài nguyên của tài khoản sẽ là chủ sở hữu chính của tài khoản được tạo. Mã này phải có dạng accounts/{accountId}/ .
|
Nội dung yêu cầu
Nội dung yêu cầu chứa một bản sao của Account
.
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ chứa một thực thể mới được tạo của Account
.
Phạm vi uỷ quyền
Yêu cầu một trong các phạm vi OAuth sau:
https://www.googleapis.com/auth/plus.business.manage
https://www.googleapis.com/auth/business.manage
Để biết thêm thông tin, hãy xem Tổng quan về OAuth 2.0.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eThis endpoint creates a new Google My Business account with a specified name, type, and primary owner, but Personal accounts and Organizations cannot be created directly.\u003c/p\u003e\n"],["\u003cp\u003eLocation Groups have ownership restrictions, preventing creation by Personal accounts under certain conditions or ownership of other Location Groups.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires specifying the primary owner's account ID and the account details in the request body, using the \u003ccode\u003ePOST\u003c/code\u003e method with the provided URL.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful requests return the newly created account details, while authorization requires specific OAuth scopes for account management.\u003c/p\u003e\n"],["\u003cp\u003eThis endpoint is deprecated and Google recommends using the Account Management API instead for creating accounts.\u003c/p\u003e\n"]]],[],null,["# Method: accounts.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization Scopes](#body.aspect)\n\n| Deprecated. Please use the [Account Management API](https://developers.google.com/my-business/reference/accountmanagement/rest/v1/accounts/create) instead.\nCreates an account with the specified name and type under the given parent.\n\n- Personal accounts and Organizations cannot be created.\n- User Groups cannot be created with a Personal account as primary owner.\n- Location Groups cannot be created with a primary owner of a Personal account if the Personal account is in an Organization.\n- Location Groups cannot own Location Groups.\n\n\u003cbr /\u003e\n\n### HTTP request\n\n`POST https://mybusiness.googleapis.com/v4/accounts`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `primaryOwner` | `string` The resource name of the account which will be the primary owner of the account being created. It should be of the form `accounts/{accountId}/`. |\n\n### Request body\n\nThe request body contains an instance of [Account](/my-business/reference/rest/v4/accounts#Account).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Account](/my-business/reference/rest/v4/accounts#Account).\n\n### Authorization Scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/plus.business.manage`\n- `https://www.googleapis.com/auth/business.manage`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]