您可以使用 SDK 密钥终端来管理应用的 SDK 密钥。您可以撤销已过期的密钥、撤销特定密钥或重新激活之前被撤销的密钥。
撤销过期密钥
撤销早于指定版本的所有 SDK 密钥。该操作有助于在迁移到更新 SDK 签名版本后清理旧的密钥。
API 协议
终端: https://automate.adjust.com/app-automation/app/{app_token}/secrets/revoke_outdated
方法: POST
请求正文 :撤销过期请求
响应 :撤销过期响应
参数
| 参数 | 数据类型 | 位置 | 必要参数 | 描述 |
|---|---|---|---|---|
app_token | String | Path | 是 | Adjust 应用识别码, |
min_active_version | Integer | 正文 (Body) | 否 | 保持活跃状态的密钥最低版本。早于此版本的密钥将被撤销。默认为 3。 |
force | Boolean | 正文 (Body) | 否 | 设置为 true,即便撤销后不会有其他活跃密钥,也强制撤销密钥。默认设置为 false。 |
行为
- 版本低于
min_active_version的密钥将被撤销。 - 如果撤销会导致 所有可用密钥失效 ,除非设置了
force: true,否则作业就会失败。 - 默认
min_active_version设置为3,也就是说,v1 和 v2 密钥会被撤销,只保留 v3 密钥。
示例
撤销所有早于 v3 的密钥
curl --location 'https://automate.adjust.com/app-automation/app/abc123xyz/secrets/revoke_outdated' \--header 'Authorization: Bearer {your-adjust-api-token}' \--header 'Content-Type: application/json' \--data '{ "min_active_version": 3}'{ "combined_secrets": { "enforce_install_signing": true, "secrets": [ { "id": 1001, "name": "Legacy Secret", "active": false, "value": ["secret1", "secret2", "info1", "info2"], "internal_version": 3, "version": 2, "created_at": "2023-01-15T10:30:00Z", "updated_at": "2024-06-15T14:00:00Z" }, { "id": 2001, "platform": "android", "label": "Android SDK Secret", "active": true, "algorithm": "adj1", "internal_version": "3.47.0", "version": 3, "created_at": "2024-06-01T12:00:00Z", "updated_at": "2024-06-01T12:00:00Z" } ] }, "revoked": 1}在无剩余活跃密钥的情况下依然强制撤销
curl --location 'https://automate.adjust.com/app-automation/app/abc123xyz/secrets/revoke_outdated' \--header 'Authorization: Bearer {your-adjust-api-token}' \--header 'Content-Type: application/json' \--data '{ "min_active_version": 3, "force": true}'撤销特定密钥
通过 ID 撤销特定 SDK 密钥。此操作会立即禁用密钥。
API 协议
终端: https://automate.adjust.com/app-automation/app/{app_token}/secrets/{secret_id}/revoke
方法: POST
响应: 成功时 HTTP 202 Accepted
参数
| 参数 | 数据类型 | 位置 | 必要参数 | 描述 |
|---|---|---|---|---|
app_token | String | Path | 是 | Adjust 应用识别码, |
secret_id | Integer | Path | 是 | 要撤销的密钥 ID。 |
示例
curl --location --request POST 'https://automate.adjust.com/app-automation/app/abc123xyz/secrets/1001/revoke' \--header 'Authorization: Bearer {your-adjust-api-token}'HTTP/1.1 202 Accepted重新激活密钥
重新激活之前被撤销的 SDK 密钥。此操作会再次激活密钥。
API 协议
终端: https://automate.adjust.com/app-automation/app/{app_token}/secrets/{secret_id}/reactivate
方法: POST
响应: 成功时 HTTP 202 Accepted
参数
| 参数 | 数据类型 | 位置 | 必要参数 | 描述 |
|---|---|---|---|---|
app_token | String | Path | 是 | Adjust 应用识别码, |
secret_id | Integer | Path | 是 | 要重新激活的密钥 ID。 |
示例
curl --location --request POST 'https://automate.adjust.com/app-automation/app/abc123xyz/secrets/1001/reactivate' \--header 'Authorization: Bearer {your-adjust-api-token}'HTTP/1.1 202 Accepted查看所有密钥
要查看应用的所有 SDK 密钥,请使用带有 combined_secrets 部分的应用设置终端:
curl --location 'https://automate.adjust.com/app-automation/app/abc123xyz/settings?sections=combined_secrets' \--header 'Authorization: Bearer {your-adjust-api-token}'{ "combined_secrets": { "enforce_install_signing": true, "secrets": [ { "id": 1001, "name": "Legacy Secret v2", "active": true, "value": ["secret1", "secret2", "info1", "info2"], "internal_version": 3, "version": 2, "created_at": "2023-01-15T10:30:00Z", "updated_at": "2023-01-15T10:30:00Z" }, { "id": 2001, "platform": "android", "label": "Android SDK Secret", "active": true, "algorithm": "adj1", "internal_version": "3.47.0", "version": 3, "created_at": "2024-06-01T12:00:00Z", "updated_at": "2024-06-01T12:00:00Z" }, { "id": 2002, "platform": "ios", "label": "iOS SDK Secret", "active": true, "algorithm": "adj1", "internal_version": "3.47.0", "version": 3, "created_at": "2024-06-01T12:00:00Z", "updated_at": "2024-06-01T12:00:00Z" } ] }}数据模型
撤销过期请求
| 参数 | 数据类型 | 描述 |
|---|---|---|
min_active_version | Integer | 保持活跃状态的密钥最低版本。更早的密钥将被撤销。默认为 3。 |
force | Boolean | 在没有剩余的活跃密钥的情况下依旧撤销密钥。默认为 false。 |
撤销过期响应
| 参数 | 数据类型 | 描述 |
|---|---|---|
combined_secrets* | Object | 撤销后的已更新密钥状态。 |
revoked* | Integer | 已撤销的密钥数量。 |
组合密钥
| 参数 | 数据类型 | 描述 |
|---|---|---|
enforce_install_signing* | Boolean | 是否拒绝签名不符合要求的安装。 |
secrets* | Array[Object] | 所有 SDK 密钥列表,包括旧版密钥。 |
旧版密钥
| 参数 | 数据类型 | 描述 |
|---|---|---|
id* | Integer | 密钥 ID。 |
name | String | 密钥名称/标签。 |
active* | Boolean | 密钥是否已激活。 |
value* | Array[String] | 密钥值 (4 个元素)。 |
internal_version* | Integer | SDK 签名库版本。 |
version* | Integer | SDK 密钥版本 (1 或 2)。 |
created_at* | String | 密钥创建时的日期时间 (ISO 格式)。 |
updated_at* | String | 密钥最后更新的日期时间 (ISO 格式)。 |
SDK 密钥 ID
| 参数 | 数据类型 | 描述 |
|---|---|---|
id* | Integer | 密钥 ID。 |
platform* | String | 定向平台 (android 或 ios)。 |
label* | String | 人类可读的密钥标签。 |
active* | Boolean | 密钥是否已激活。 |
algorithm* | String | 使用的签名算法。 |
internal_version* | String | SDK 签名库版本。 |
version* | Integer | SDK 密钥版本 (3 或更高)。 |
created_at* | String | 密钥创建时的日期时间 (ISO 格式)。 |
updated_at* | String | 密钥最后更新的日期时间 (ISO 格式)。 |