Get Android App Upgrade Strategy
Interface Description: Get the corresponding upgrade strategy based on the client's version number
📮Request Information
Request URL
POST https://api.upgrade.toolsetlink.com/v1/apk/upgrade
Request Headers
| Parameter Name | Required | Type | Example Value | Description |
|---|---|---|---|---|
| X-Timestamp | Yes | string | 2025-02-17T10:34:55+08:00 | Request time in RFC3339 format |
| X-Nonce | Yes | string | fc812cc0b9b51e8c | Unique random string (at least 16 characters) |
| X-AccessKey | Yes | string | mui2W50H1j-OC4xD6PgQag | AccessKey secret key |
| X-Signature | Yes | string | 3603437250c2df51fc46426ac79d8995 | Request signature Signature Rules |
| Content-Type | Yes | string | application/json |
🔐 Anti-Replay Attack Mechanism
- Server verifies that the timestamp difference from server time does not exceed ±5 minutes
- Server checks if the Nonce value already exists (to prevent duplicate requests)
Request Body
json
{
"apkKey": "isVZBUvkFhv6oHxk_X-D0Q",
"versionCode": 1,
"appointVersionCode": 0,
"devModelKey": "stv1",
"devKey": "LOYlLXNy7w",
"patchAlgo": 0
}Request Body Parameter Description
| Parameter Name | Required | Type | Example Value | Description |
|---|---|---|---|---|
| apkKey | Yes | string | isVZBUvkFhv6oHxk_X-D0Q | Android app unique identifier |
| versionCode | Yes | int | 1 | Client version code |
| appointVersionCode | No | int | 0 | Expected upgrade version code, 0 or not passed means request latest version |
| devModelKey | No | string | stv1 | Device model unique identifier |
| devKey | No | string | LOYlLXNy7w | Device unique identifier (can use mac as unique identifier) |
| patchAlgo | No | int | 0 | Upgrade algorithm: 0: Full upgrade; 1: HDiffPatch algorithm |
📮Response Information
Success Response Body
json
{
"code": 200,
"msg": "New version obtained",
"data": {
"apkKey": "isVZBUvkFhv6oHxk_X-D0Q",
"packageName": "com.a.c",
"versionName": "v2",
"versionCode": 2,
"urlPath": "http://file.com/2.apk",
"urlFileSize": 7213,
"urlFileMd5": "36ee2a36b5d20d1008507d253423eea7",
"patchAlgo": 0,
"patchUrlPath": "http://file.com/1-2.patch",
"patchUrlFileSize": 203,
"patchUrlFileMd5": "36ee2a36b5d20d1008507d253423eea7",
"upgradeType": 1,
"promptUpgradeContent": "Prompt content"
}
}Response Body Parameter Description
| Parameter Name | Type | Example Value | Description |
|---|---|---|---|
| apkKey | string | isVZBUvkFhv6oHxk_X-D0Q | Android app unique identifier |
| packageName | string | com.a.c | Android app package name |
| versionName | string | v1 | Version name |
| versionCode | int | 1 | Version code |
| urlPath | string | http://file.com/2.apk | File download address |
| urlFileSize | int | 7213 | File size (bytes) |
| urlFileMd5 | string | 36ee2a36b5d20d1008507d253423eea7 | File md5 |
| patchAlgo | int | 0 | Upgrade algorithm: 0: Full upgrade; 1: HDiffPatch algorithm |
| patchUrlPath | string | http://file.com/1-2.patch | Patch file download address |
| patchUrlFileSize | int | 7213 | Patch file size (bytes) |
| patchUrlFileMd5 | string | 36ee2a36b5d20d1008507d253423eea7 | Patch file md5 |
| upgradeType | int | 1 | Upgrade method: 1: Prompt upgrade; 2: Silent upgrade; 3: Forced upgrade |
| promptUpgradeContent | string | Prompt content | Prompt upgrade description content |
Typical Error Response Body
json
{
"code": 404001,
"msg": "No available version obtained",
"docs": "No corresponding app version found. Please confirm whether it has been correctly created in the system. Please refer to the documentation: http://upgrade.toolsetlink.com/upgrade/recommend/apk/app-version.html",
"data": null
}📊Status Codes
| http status code | code | Scenario Description | Solution |
|---|---|---|---|
| 200 | 0 | Request successful, already the latest version | |
| 200 | 200 | Request successful, obtained version upgrade strategy | |
| 400 | 400001 | Illegal request | |
| 400 | 400002 | Missing parameters | |
| 400 | 400003 | Illegal parameters | |
| 400 | 400004 | Illegal header | |
| 400 | 400005 | Illegal body | |
| 401 | 401001 | Authentication failed | |
| 401 | 401002 | Signature verification failed | |
| 404 | 404001 | Resource not found | |
| 404 | 404002 | Query record not found | |
| 404 | 404003 | Processing method not found | |
| 404 | 404004 | Request not found | |
| 429 | 429001 | Application task strategy request flow control limit | The request flow control strategy for the current upgrade task has reached the limit, please try again later. |
| 500 | 500001 | Server internal error | Please contact us Contact Us |
| 500 | 500002 | Server internal data verification failed | Please contact us Contact Us |