Method: apprecovery.addTargeting
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
逐步更新恢复操作的定位条件。请注意,只能展开在创建恢复操作期间选择的条件。
HTTP 请求
POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/appRecoveries/{appRecoveryId}:addTargeting
网址采用 gRPC 转码语法。
路径参数
参数 |
packageName |
string
必需。需要更新恢复操作的应用的软件包名称。
|
appRecoveryId |
string (int64 format)
必需。与应用恢复操作对应的 ID。
|
请求正文
请求正文中包含结构如下的数据:
字段 |
targetingUpdate |
object (TargetingUpdate )
指定定位更新,例如区域、Android SDK 版本等。
|
授权范围
需要以下 OAuth 范围:
https://www.googleapis.com/auth/androidpublisher
TargetingUpdate
JSON 表示法 |
{
// Union field criteria can be only one of the following:
"regions": {
object (Regions )
},
"androidSdks": {
object (AndroidSdks )
},
"allUsers": {
object (AllUsers )
}
// End of list of possible types for union field criteria .
} |
字段 |
联合字段 criteria 。恢复操作中的定位条件。请注意,除非条件不是 all_users,否则条件应始终与创建应用恢复操作时使用的条件相同。否则,更新会被拒绝。如果之前将条件设置为定位 all_users,则无法更新定位。如果无法按照请求展开目标组,系统会抛出错误。criteria 只能是下列其中一项: |
regions |
object (Regions )
恢复操作定位到了其他区域。
|
androidSdks |
object (AndroidSdks )
恢复操作针对的是其他 Android SDK 级别。
|
allUsers |
object (AllUsers )
已定位到所有用户。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eIncrementally update targeting for a recovery action, expanding only criteria selected during its creation.\u003c/p\u003e\n"],["\u003cp\u003eUtilize an HTTP POST request to \u003ccode\u003ehttps://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/appRecoveries/{appRecoveryId}:addTargeting\u003c/code\u003e to initiate the update.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must contain a \u003ccode\u003etargetingUpdate\u003c/code\u003e object specifying updates for regions, Android SDK versions, or user targeting.\u003c/p\u003e\n"],["\u003cp\u003eTargeting updates must align with the criteria initially set for the recovery action; attempting to expand beyond those parameters will result in an error.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful updates result in an empty response body.\u003c/p\u003e\n"]]],["This outlines how to update the targeting of an app recovery action using a `POST` request to a specific URL. The request requires the app's package name and recovery action ID as path parameters. The request body should contain a `targetingUpdate` object, specifying criteria like `regions` or `androidSdks` to expand the targeted group, the criteria used must be the same that was used in creation of the action. If successful, the response is empty; requires an `androidpublisher` authorization scope.\n"],null,["# Method: apprecovery.addTargeting\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [TargetingUpdate](#TargetingUpdate)\n - [JSON representation](#TargetingUpdate.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nIncrementally update targeting for a recovery action. Note that only the criteria selected during the creation of recovery action can be expanded.\n\n### HTTP request\n\n`POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/appRecoveries/{appRecoveryId}:addTargeting`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------|\n| `packageName` | `string` Required. Package name of the app for which recovery action is to be updated. |\n| `appRecoveryId` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Required. ID corresponding to the app recovery action. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"targetingUpdate\": { object (/android-publisher/api-ref/rest/v3/apprecovery/addTargeting#TargetingUpdate) } } ``` |\n\n| Fields ||\n|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `targetingUpdate` | `object (`[TargetingUpdate](/android-publisher/api-ref/rest/v3/apprecovery/addTargeting#TargetingUpdate)`)` Specifies targeting updates such as regions, android sdk versions etc. |\n\n### Response body\n\nIf successful, the response body is empty.\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/androidpublisher`\n\nTargetingUpdate\n---------------\n\nUpdate type for targeting. Note it is always a subset Targeting.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { // Union field `criteria` can be only one of the following: \"regions\": { object (/android-publisher/api-ref/rest/v3/Regions) }, \"androidSdks\": { object (/android-publisher/api-ref/rest/v3/AndroidSdks) }, \"allUsers\": { object (/android-publisher/api-ref/rest/v3/AllUsers) } // End of list of possible types for union field `criteria`. } ``` |\n\n| Fields ||\n|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| Union field `criteria`. Criteria for targeting in recovery action. Note that unless the criteria is not all_users, the criteria should always be the same as what was used during creation of app recovery action. Otherwise the update is rejected. In case criteria was previously set to target all_users, targeting update is impossible. In case the target group cannot be expanded as per the request, an error is thrown. `criteria` can be only one of the following: ||\n| `regions` | `object (`[Regions](/android-publisher/api-ref/rest/v3/Regions)`)` Additional regions are targeted by the recovery action. |\n| `androidSdks` | `object (`[AndroidSdks](/android-publisher/api-ref/rest/v3/AndroidSdks)`)` Additional android sdk levels are targeted by the recovery action. |\n| `allUsers` | `object (`[AllUsers](/android-publisher/api-ref/rest/v3/AllUsers)`)` All users are targeted. |"]]