Electron Application Get Upgrade Strategy
Interface Description: Get corresponding upgrade strategy based on client version number, compatible with the official Electron upgrade interface.
📮 Request Information
Request Address
GET http://0.0.0.0:8888/v1/electron/upgrade?electronKey=kPUtUMDIjBhS48q5771pow&versionName=1.1.1&appointVersionName=&devModelKey=&devKey=&platform=darwin&arch=arm64
Request Headers
| Parameter Name | Required | Type | Example Value | Description |
|---|---|---|---|---|
| X-AccessKey | Yes | string | mui2W50H1j-OC4xD6PgQag | Access Key |
Request Parameter Description
| Parameter Name | Required | Type | Example Value | Description |
|---|---|---|---|---|
| electronKey | Yes | string | kPUtUMDIjBhS48q5771pow | Electron application unique identifier |
| versionName | Yes | string | 1.0.0 | Version number recorded in system |
| appointVersionName | No | string | 1.0.1 | Expected upgrade version name, defaults to latest version if not provided or empty |
| appointVersionCode | No | int | 0 | 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 | LOYlLXNy7w | Device unique identifier (can use MAC address as unique identifier) |
| platform | Yes | string | linux | Operating system: linux, darwin, windows |
| arch | Yes | string | x64 | Machine architecture: x64, arm64 |
📮 Response Information
Success Response Body
json
{
"upgradeType": 1,
"promptUpgradeContent": "Prompt upgrade content",
"version": "1.2.0",
"files": [
{
"url": "https://api.upgrade.toolsetlink.com/v1/electron/download.AppImage?electronKey=kPUtUMDIjBhS48q5771pow&versionId=7",
"sha512": "sNEx4hgG+cxFAULCDl9uOXJN+i4o/ND0adGphOP4Atbthvfmqb4uyLTENrrCyAIy0zaRxmFtI2aHiS/Da2uOyw==",
"size": 153453614
},
{
"url": "https://api.upgrade.toolsetlink.com/v1/electron/download.AppImage?electronKey=kPUtUMDIjBhS48q5771pow&versionId=7",
"sha512": "sNEx4hgG+cxFAULCDl9uOXJN+i4o/ND0adGphOP4Atbthvfmqb4uyLTENrrCyAIy0zaRxmFtI2aHiS/Da2uOyw==",
"size": 153453614
}
],
"path": "https://api.upgrade.toolsetlink.com/v1/electron/download.AppImage?electronKey=kPUtUMDIjBhS48q5771pow&versionId=7",
"sha512": "sSrgmnph5Cr2AuZwCEWXD90JiJ2JW0RnqLf8cXSxusHLssCPRlAFtpER74Rlw/LglbOlcYvh+IO3jsAxAdLQmw==",
"releaseDate": ""
}Response Body Parameter Description
Return content is consistent with the official packaged yml file content.
| Parameter Name | Type | Example Value | Description |
|---|---|---|---|
| upgradeType | int | Prompt upgrade type: 1: Prompt upgrade; 2: Silent upgrade; 3: Force upgrade | |
| prompt_upgrade_content | string | Prompt upgrade content | |
| version | string | Version number | |
| path | string | Update file download path | |
| sha512 | string | Update file sha512 checksum value |
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/tauri/app-version.html",
"data": null
}📊 Status Codes
| HTTP Status Code | Code | Scenario Description | Solution |
|---|---|---|---|
| 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 |