Method: accounts.locations.patch
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
更新指定的营业地点。
只能在拥有 Google+ 信息页的营业地点上拍照。
如果该营业地点不存在,则返回 NOT_FOUND
。
HTTP 请求
PATCH https://mybusiness.googleapis.com/v4/{name=accounts/*/locations/*}
网址采用 gRPC 转码语法。
路径参数
参数 |
name |
string
要更新的营业地点的名称。
|
查询参数
参数 |
updateMask |
string (FieldMask format)
要更新的特定字段。如果未指定掩码,则视为完全更新,且所有字段都将设为传入的值,这可能包括请求中未设置的空字段。 这是以逗号分隔的完全限定字段名称列表。示例:"user.displayName,photo" 。
|
validateOnly |
boolean
如果为 true,则验证请求,而不实际更新营业地点。
|
attributeMask |
string (FieldMask format)
要更新的属性的 ID。只会更新掩码中注明的属性。如果某个属性在掩码中显示但未在营业地点中显示,则该属性将被移除。空掩码将更新所有属性。 设置此字段后,updateMask 应将属性作为要更新的字段之一。 这是以逗号分隔的完全限定字段名称列表。示例:"user.displayName,photo" 。
|
请求正文
请求正文包含一个 Location
实例。
响应正文
如果成功,则响应正文包含一个 Location
实例。
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/plus.business.manage
https://www.googleapis.com/auth/business.manage
有关详情,请参阅 OAuth 2.0 概览。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eThis document outlines how to update a specific Google My Business location using the \u003ccode\u003ePATCH\u003c/code\u003e HTTP request method.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires specifying the location's name in the URL path and can include optional query parameters like \u003ccode\u003eupdateMask\u003c/code\u003e, \u003ccode\u003evalidateOnly\u003c/code\u003e, and \u003ccode\u003eattributeMask\u003c/code\u003e to control the update process.\u003c/p\u003e\n"],["\u003cp\u003eThe request body should contain a \u003ccode\u003eLocation\u003c/code\u003e object with the desired updates, and a successful response will return the updated \u003ccode\u003eLocation\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization is necessary and requires one of the specified OAuth scopes: \u003ccode\u003ehttps://www.googleapis.com/auth/plus.business.manage\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/business.manage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003ePhotos can only be added to locations with an associated Google+ page, and attempting to update a non-existent location results in a \u003ccode\u003eNOT_FOUND\u003c/code\u003e error.\u003c/p\u003e\n"]]],["This describes updating a location using a `PATCH` request to the specified URL. The location is identified by its `name` in the path. Updates are controlled by the `updateMask` and `attributeMask` query parameters. A boolean `validateOnly` parameter allows for request validation without making changes. The request and response bodies both use a Location object. Authorization requires specific OAuth scopes. A location must have a Google+ page to be updated with photos, and requests for non-existent locations return `NOT_FOUND`.\n"],null,["# Method: accounts.locations.patch\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization Scopes](#body.aspect)\n\nUpdates the specified location.\n\nPhotos are only allowed on a location that has a Google+ page.\n\nReturns `NOT_FOUND` if the location does not exist.\n\n### HTTP request\n\n`PATCH https://mybusiness.googleapis.com/v4/{name=accounts/*/locations/*}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|----------------------------------------------|\n| `name` | `string` The name of the location to update. |\n\n### Query parameters\n\n| Parameters ||\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `updateMask` | `string (`[FieldMask](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask)` format)` The specific fields to update. If no mask is specified, then this is treated as a full update and all fields are set to the values passed in, which may include unsetting empty fields in the request. This is a comma-separated list of fully qualified names of fields. Example: `\"user.displayName,photo\"`. |\n| `validateOnly` | `boolean` If true, the request is validated without actually updating the location. |\n| `attributeMask` | `string (`[FieldMask](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask)` format)` The IDs of the attributes to update. Only attributes noted in the mask will be updated. If an attribute is present in the mask and not in the location, it will be removed. An empty mask will update all attributes. Whenever this field is set, the updateMask should include attributes as one of the fields to update. This is a comma-separated list of fully qualified names of fields. Example: `\"user.displayName,photo\"`. |\n\n### Request body\n\nThe request body contains an instance of [Location](/my-business/reference/rest/v4/accounts.locations#Location).\n\n### Response body\n\nIf successful, the response body contains an instance of [Location](/my-business/reference/rest/v4/accounts.locations#Location).\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)."]]