Skip to content

Get Android App Upgrade Strategy

Interface Description: Get the corresponding upgrade strategy based on the client's version number

📮Request Information

Request URL

POST https://api.upgrade.toolsetlink.com/v1/apk/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-OC4xD6PgQagAccessKey secret key
X-SignatureYesstring3603437250c2df51fc46426ac79d8995Request signature Signature Rules
Content-TypeYesstringapplication/json

🔐 Anti-Replay Attack Mechanism

  1. Server verifies that the timestamp difference from server time does not exceed ±5 minutes
  2. Server checks if the Nonce value already exists (to prevent duplicate requests)

Request Body

json
{
  "apkKey": "isVZBUvkFhv6oHxk_X-D0Q",
  "versionCode": 1,
  "appointVersionCode": 0,
  "devModelKey": "stv1",
  "devKey": "LOYlLXNy7w",
  "patchAlgo": 0
}

Request Body Parameter Description

Parameter NameRequiredTypeExample ValueDescription
apkKeyYesstringisVZBUvkFhv6oHxk_X-D0QAndroid app unique identifier
versionCodeYesint1Client version code
appointVersionCodeNoint0Expected upgrade version code, 0 or not passed means request latest version
devModelKeyNostringstv1Device model unique identifier
devKeyNostringLOYlLXNy7wDevice unique identifier (can use mac as unique identifier)
patchAlgoNoint0Upgrade algorithm: 0: Full upgrade; 1: HDiffPatch algorithm

📮Response Information

Success Response Body

json
{
  "code": 200,
  "msg": "New version obtained",
  "data": {
    "apkKey": "isVZBUvkFhv6oHxk_X-D0Q",
    "packageName": "com.a.c",
    "versionName": "v2",
    "versionCode": 2,
    "urlPath": "http://file.com/2.apk",
    "urlFileSize": 7213,
    "urlFileMd5": "36ee2a36b5d20d1008507d253423eea7",
    "patchAlgo": 0,
    "patchUrlPath": "http://file.com/1-2.patch",
    "patchUrlFileSize": 203,
    "patchUrlFileMd5": "36ee2a36b5d20d1008507d253423eea7",
    "upgradeType": 1,
    "promptUpgradeContent": "Prompt content"
  }
}

Response Body Parameter Description

Parameter NameTypeExample ValueDescription
apkKeystringisVZBUvkFhv6oHxk_X-D0QAndroid app unique identifier
packageNamestringcom.a.cAndroid app package name
versionNamestringv1Version name
versionCodeint1Version code
urlPathstringhttp://file.com/2.apkFile download address
urlFileSizeint7213File size (bytes)
urlFileMd5string36ee2a36b5d20d1008507d253423eea7File md5
patchAlgoint0Upgrade algorithm: 0: Full upgrade; 1: HDiffPatch algorithm
patchUrlPathstringhttp://file.com/1-2.patchPatch file download address
patchUrlFileSizeint7213Patch file size (bytes)
patchUrlFileMd5string36ee2a36b5d20d1008507d253423eea7Patch file md5
upgradeTypeint1Upgrade method: 1: Prompt upgrade; 2: Silent upgrade; 3: Forced upgrade
promptUpgradeContentstringPrompt contentPrompt upgrade description content

Typical Error Response Body

json
{
  "code": 404001,
  "msg": "No available version obtained",
  "docs": "No corresponding app version found. Please confirm whether it has been correctly created in the system. Please refer to the documentation: http://upgrade.toolsetlink.com/upgrade/recommend/apk/app-version.html",
  "data": null
}

📊Status Codes

http status codecodeScenario DescriptionSolution
2000Request successful, already the latest version
200200Request successful, obtained version upgrade strategy
400400001Illegal request
400400002Missing parameters
400400003Illegal parameters
400400004Illegal header
400400005Illegal body
401401001Authentication failed
401401002Signature verification failed
404404001Resource not found
404404002Query record not found
404404003Processing method not found
404404004Request not found
429429001Application task strategy request flow control limitThe request flow control strategy for the current upgrade task has reached the limit, please try again later.
500500001Server internal errorPlease contact us Contact Us
500500002Server internal data verification failedPlease contact us Contact Us

toolsetlink@163.com