Skip to content

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 NameRequiredTypeExample ValueDescription
X-AccessKeyYesstringmui2W50H1j-OC4xD6PgQagSecret key AccessKey

Request Parameters

Parameter NameRequiredTypeExample ValueDescription
electronKeyYesstringkPUtUMDIjBhS48q5771powUnique Electron app identifier
versionNameYesstring1.0.0Version number
appointVersionNameNostring1.2.0Expected upgrade version name, defaults to latest version if not provided
appointVersionCodeNoint0Expected upgrade version code, defaults to latest version if not provided
devModelKeyNostringstv1Unique device model identifier
devKeyNostringLOYlLXNy7wUnique device identifier (can use MAC address as unique identifier)
platformYesstringlinuxOperating system: linux, darwin, windows
archYesstringx64Machine 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 NameTypeExample ValueDescription
upgradeTypeintUpgrade notification type: 1: Prompt upgrade; 2: Silent upgrade; 3: Forced upgrade
prompt_upgrade_contentstringUpgrade notification content
versionstringVersion number
pathstringUpdate file download path
sha512stringUpdate 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 CodeCodeScenario DescriptionSolution
200Request successful, obtained version upgrade strategy
400400001Invalid request
400400002Parameter missing
400400003Invalid parameter
400400004Invalid header
400400005Invalid body
401401001Authentication failed
401401002Signature verification failed
404404001Resource not found
404404002Record not found
404404003Processing method not found
404404004Request not found
429429001Application task strategy request rate limitThe request rate limit configured for the current upgrade task has been reached, please try again later.
500500001Server internal errorPlease contact us Contact Us
500500002Server internal data verification failedPlease contact us Contact Us

toolsetlink@163.com