URL Application Get Upgrade Strategy
Interface Description: Get corresponding upgrade strategy based on client version number
📮 Request Information
Request Address
POST https://api.upgrade.toolsetlink.com/v1/url/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 | Access Key |
| X-Signature | Yes | string | 3603437250c2df51fc46426ac79d8995 | Request signature Signature Rules |
| Content-Type | Yes | string | application/json |
🔐 Replay Attack Prevention Mechanism
- Server validates timestamp difference with server time not exceeding ±5 minutes
- Server checks if Nonce value already exists (prevents duplicate requests)
Request Body
json
{
"urlKey": "SkEgKQ4SyLmzazl31fJnAw",
"versionCode": 1,
"appointVersionCode": 0,
"devModelKey": "stv1",
"devKey": "LOYlLXNy7w"
}Request Body Parameter Description
| Parameter Name | Required | Type | Example Value | Description |
|---|---|---|---|---|
| urlKey | Yes | string | SkEgKQ4SyLmzazl31fJnAw | URL application unique identifier |
| versionCode | Yes | int | 1 | Version number recorded in system |
| appointVersionCode | No | int | 2 | Expected upgrade version number, defaults to latest version if not provided or set to 0 |
| devModelKey | No | string | stv1 | Device model unique identifier |
| devKey | No | string | 89c8b3d5f2a74e1b | Device unique identifier (can use MAC address as unique identifier) |
📮 Response Information
Success Response Body
json
{
"code": 200,
"msg": "New version obtained",
"data": {
"urlKey": "SkEgKQ4SyLmzazl31fJnAw",
"versionName": "v2",
"versionCode": 2,
"urlPath": "http://file.com/2.exe",
"upgradeType": 1,
"promptUpgradeContent": "Prompt content"
}
}Response Body Parameter Description
| Parameter Name | Type | Example Value | Description |
|---|---|---|---|
| urlKey | string | SkEgKQ4SyLmzazl31fJnAw | URL application unique identifier |
| versionName | string | v1 | Version name |
| versionCode | int | 1 | Version number |
| urlPath | string | http://file.com/2.exe | File download address |
| upgradeType | int | 1 | Upgrade method: 1: Prompt upgrade; 2: Silent upgrade; 3: Force upgrade |
| promptUpgradeContent | string | Code optimization | Prompt upgrade description content |
Typical Error Response Body
json
{
"code": 404001,
"msg": "No usable version found",
"docs": "No corresponding application version found. Please confirm if it has been correctly created in the system. Please refer to documentation: http://upgrade.toolsetlink.com/upgrade/recommend/url/app-version.html",
"data": null
}📊 Status Codes
| HTTP Status Code | Code | Scenario Description | Solution |
|---|---|---|---|
| 200 | 0 | Request successful, already latest version | |
| 200 | 200 | Request successful, obtained upgrade strategy | |
| 400 | 400001 | Illegal request | |
| 400 | 400002 | Missing parameters | |
| 400 | 400003 | Invalid parameters | |
| 400 | 400004 | Invalid headers | |
| 400 | 400005 | Invalid request 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 rate limit | Current upgrade task configuration's request rate limit has been reached, please try again later. |
| 500 | 500001 | Server internal error | Contact us Contact Us |
| 500 | 500002 | Server internal data validation failed | Contact us Contact Us |