Skip to content

Event Reporting

Interface Description: Report corresponding content based on different event types.

Based on the reported event type data, it will be reflected in the system's statistical data.

📮 Request Information

Request URL

POST https://api.upgrade.toolsetlink.com/v1/app/report

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 not exceeding ±5 minutes
  2. Server checks if Nonce value already exists (prevents duplicate requests)

Request Body Parameter Description

Parameter NameRequiredTypeExample ValueDescription
eventType Yes string app_start Event Type:
app_start Application startup event
app_upgrade_download Application upgrade - download event
app_upgrade_upgrade Application upgrade - upgrade event
appKey Yes LOYlLXNy7wV3ySuh0XgtSg LOYlLXNy7wV3ySuh0XgtSg Application unique identifier, value is the same as urlKey and fileKey
timestamp Yes string 2025-02-17T10:34:55+08:00 Event occurrence time
eventData Yes Extended fields
(Event type app_start Application startup event)
- launchTime Yes string 2025-02-17T10:34:55+08:00 Application startup time in RFC3339 format
- versionCode Yes int 10 Current application version number
- devModelKey No string stv1 Device model unique identifier
- devKey No string 89c8b3d5f2a74e1b Device unique identifier (can use mac as unique identifier)
- target No string darwin Device system
- arch No string x86_64 Device architecture
eventData Yes Extended fields
(Event type app_upgrade_download Application upgrade - download event)
- downloadVersionCode Yes int 11 Upgrade version returned by upgrade strategy
- codeYesint0
0Download successful
1Download failed (generic)
1001Application file download HTTP error
1002Insufficient disk space for file download
1003Download file operation error, file (create/move/rename) failed
1004File MD5 verification failed
- versionCode Yes int 10 Current application version number
- devModelKey No string stv1 Device model unique identifier
- devKey No string 89c8b3d5f2a74e1b Device unique identifier (can use mac as unique identifier)
- target No string darwin Device system
- arch No string x86_64 Device architecture
eventData Yes Extended fields
(Event type app_upgrade_upgrade Application upgrade - upgrade event)
- upgradeVersionCode Yes int 11 Upgrade version returned by upgrade strategy
- codeYesint0
0Upgrade successful
1Upgrade failed (generic)
- versionCode Yes int 10 Current application version number
- devModelKey No string stv1 Device model unique identifier
- devKey No string 89c8b3d5f2a74e1b Device unique identifier (can use mac as unique identifier)
- target No string darwin Device system
- arch No string x86_64 Device architecture

Request Body Examples

app_download Application - download event (Automatically recorded when calling first download interface, no need to request)

json
{
    "eventType": "app_download",
    "timestamp": "2025-02-17T10:34:55+08:00",
    "appKey": "SkEgKQ4SyLmzazl31fJnAw"
}

app_start Application - startup event

json
{
    "eventType": "app_start",
    "timestamp": "2025-02-17T10:34:55+08:00",
    "appKey": "SkEgKQ4SyLmzazl31fJnAw",
    "eventData": {
      "launchTime": "2025-02-17T10:34:55+08:00",
      "versionCode": 1,
      "target": "darwin",
      "arch": "x86_64",
      "devModelKey": "stv1",
      "devKey": "LOYlLXNy7w"
    }
}

app_upgrade_get_strategy Application upgrade - get upgrade strategy event (Automatically recorded when calling get latest version interface, no need to request)

json
{
    "eventType": "app_upgrade_get_strategy",
    "timestamp": "2025-02-17T10:34:55+08:00",
    "appKey": "SkEgKQ4SyLmzazl31fJnAw",
    "eventData": {
      "versionCode": 1,
      "target": "darwin",
      "arch": "x86_64",
      "devModelKey": "stv1",
      "devKey": "LOYlLXNy7w"
    }
}

app_upgrade_download Application upgrade - download event

json
{
    "eventType": "app_upgrade_download",
    "timestamp": "2025-02-17T10:34:55+08:00",
    "appKey": "SkEgKQ4SyLmzazl31fJnAw",
    "eventData": {
      "downloadVersionCode": 2,
      "code": 0,
      "versionCode": 1,
      "target": "darwin",
      "arch": "x86_64",
      "devModelKey": "stv1",
      "devKey": "LOYlLXNy7w"
    }
}

app_upgrade_upgrade Application upgrade - upgrade event

json
{
    "eventType": "app_upgrade_upgrade",
    "timestamp": "2025-02-17T10:34:55+08:00",
    "appKey": "SkEgKQ4SyLmzazl31fJnAw",
    "eventData": {
      "upgradeVersionCode": 2,
      "code": 0,
      "versionCode": 1,
      "target": "darwin",
      "arch": "x86_64",
      "devModelKey": "stv1",
      "devKey": "LOYlLXNy7w"
    }
}

📮 Response Information

Success Response Body

json
{
  "code": 200,
  "msg": "Report successful"
}

Typical Error Response Body

json
{
  "code": 400002,
  "msg": "Missing parameters"
}

📊 Status Codes

HTTP Status CodeCodeScenario DescriptionSolution
2000Request successful
400400001Illegal request
400400002Missing parameters
400400003Invalid parameters
400400004Invalid headers
400400005Invalid request body
401401001Authentication failed
401401002Signature verification failed
404404001Resource does not exist
404404002Query record does not exist
404404003Processing method does not exist
404404004Request does not exist
500500001Server internal errorContact us Contact Us
500500002Server internal data validation failedContact us Contact Us

toolsetlink@163.com