Skip to content

File Application Get Upgrade Strategy

API Description: Get corresponding upgrade strategy based on client version number

📮 Request Information

Request URL

POST https://api.upgrade.toolsetlink.com/v1/file/upgrade

Request Headers

Parameter NameRequiredTypeExample ValueDescription
X-TimestampYesstring2025-02-17T10:34:55+08:00Request time in RFC3339 format
X-NonceYesstringfc812cc0b9b51e8cUnique random string (at least 16 characters)
X-AccessKeyYesstringmui2W50H1j-OC4xD6PgQagAccess Key
X-SignatureYesstring3603437250c2df51fc46426ac79d8995Request signature Signature Rules
Content-TypeYesstringapplication/json

🔐 Replay Attack Prevention Mechanism

  1. Server validates timestamp difference with server time within ±5 minutes
  2. Server checks if Nonce value already exists (prevents duplicate requests)

Request Body

json
{
    "fileKey": "LOYlLXNy7wV3ySuh0XgtSg",
    "versionCode": 1,
    "appointVersionCode": 0,
    "devModelKey": "stv1",
    "devKey": "LOYlLXNy7w"
}

Request Body Parameters

Parameter NameRequiredTypeExample ValueDescription
fileKeyYesstringLOYlLXNy7wV3ySuh0XgtSgFile application unique identifier
versionCodeYesint1Version number recorded in the system
appointVersionCodeNoint0Expected upgrade version number, pass 0 or omit to request latest version
devModelKeyNostringstv1Device model unique identifier
devKeyNostringLOYlLXNy7wDevice unique identifier (can use MAC as unique identifier)

📮 Response Information

Success Response Body

json
{
  "code": 200,
  "msg": "New version obtained",
  "data": {
    "fileKey": "LOYlLXNy7wV3ySuh0XgtSg",
    "versionName": "v2",
    "versionCode": 2,
    "urlPath": "http://file.com/2.exe",
    "upgradeType": 1,
    "promptUpgradeContent": "Prompt content"
  }
}

Response Body Parameters

Parameter NameTypeExample ValueDescription
fileKeystringLOYlLXNy7wV3ySuh0XgtSgFile application unique identifier
versionNamestringv1Version name
versionCodeint1Version number
urlPathstringhttp://file.com/2.exeFile download address
upgradeTypeint1Upgrade method: 1: Prompt upgrade; 2: Silent upgrade; 3: Force upgrade
promptUpgradeContentstringPrompt contentPrompt upgrade description content

Typical Error Response Body

json
{
  "code": 404001,
  "msg": "No available 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/file/app-version.html",
  "data": null
}

📊 Status Codes

HTTP StatusCodeScenario DescriptionSolution
2000Request successful, already latest version
200200Request successful, obtained version upgrade strategy
400400001Illegal request
400400002Missing parameters
400400003Invalid parameters
400400004Invalid headers
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 limitCurrent upgrade task configuration request rate limit policy has been reached, please try again later.
500500001Server internal errorContact us Contact Us
500500002Server internal data validation failedContact us Contact Us

toolsetlink@163.com