Electron App - Get Upgrade Strategy
API Description: Based on the client's version number, retrieve the corresponding upgrade strategy, compatible with the upgrade interface provided by Electron official.
📮 Request Information
Request URL
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 | Secret key AccessKey |
Request Parameters
| Parameter Name | Required | Type | Example Value | Description |
|---|---|---|---|---|
| electronKey | Yes | string | kPUtUMDIjBhS48q5771pow | Unique Electron app identifier |
| versionName | Yes | string | 1.0.0 | Version number |
| appointVersionName | No | string | 1.2.0 | Expected upgrade version name, defaults to latest version if not provided |
| appointVersionCode | No | int | 0 | Expected upgrade version code, defaults to latest version if not provided |
| devModelKey | No | string | stv1 | Unique device model identifier |
| devKey | No | string | LOYlLXNy7w | Unique device 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
Successful Response Body
json
{
"upgradeType": 1,
"promptUpgradeContent": "Upgrade notification 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": ""
}Successful Response Body (Already at the latest version)
json
{
"promptUpgradeContent": "Already latest version",
"version": "1.0.0"
}When the system determines that the requested version is already the latest, the version field will return the currently requested versionName.
Response Body Parameters
The returned content is consistent with the content of the officially packaged yml file.
| Parameter Name | Type | Example Value | Description |
|---|---|---|---|
| upgradeType | int | Upgrade notification type: 1: Prompt upgrade; 2: Silent upgrade; 3: Forced upgrade | |
| prompt_upgrade_content | string | Upgrade notification content | |
| version | string | Version number | |
| path | string | Update file download path | |
| sha512 | string | Update file sha512 checksum |
Typical Error Response Body
json
{
"code": 404001,
"msg": "No available version obtained",
"docs": "No corresponding application version found, please confirm whether it has been correctly created in the system. Please refer to the 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 version upgrade strategy | ||
| 400 | 400001 | Invalid request | |
| 400 | 400002 | Parameter missing | |
| 400 | 400003 | Invalid parameter | |
| 400 | 400004 | Invalid header | |
| 400 | 400005 | Invalid body | |
| 401 | 401001 | Authentication failed | |
| 401 | 401002 | Signature verification failed | |
| 404 | 404001 | Resource not found | |
| 404 | 404002 | Record not found | |
| 404 | 404003 | Processing method not found | |
| 404 | 404004 | Request not found | |
| 429 | 429001 | Application task strategy request rate limit | The request rate limit configured for the current upgrade task has been reached, 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 |