Image Annotation Callback API

API Overview

After manual image annotation, the platform sends the original moderation data and updated annotation to your callback URL. Configure it under Project > Service Configuration > Annotation API Callback. Manual annotations can be updated individually or in batches under Project > Data Query.

POSTcallbackUrl

Request Parameters

Request Headers

All headers are required.

Header Value Description
Content-Type application/json;charset=UTF-8 Request body format
Accept application/json;charset=UTF-8 Expected response format
X-AppId — Project ID from Service Configuration
X-TimeStamp — UTC request time in W3C format. Example: 2026-09-30T02:30:00Z. Use the current request time.
Authorization — Signature calculated as described below

Request Body

Parameter Type Required Description
appId String Required Project ID
imageData Array Required Original image moderation data
markData Object Required Updated manual annotation

Request Example

{
  "appId": "81000001",
  "imageData": [
    {
      "taskId": "us_b0db751223584cf5af9d5c469bb9e4d1_1694159664104",
      "strategyId": "DEFAULT",
      "url": "https://example.com/image.jpg",
      "displayUrl": "https://example.com/image.jpg",
      "code": 0,
      "result": 0,
      "imageCheckType": [],
      "tags": [],
      "subTags": [],
      "userId": null,
      "md5": "CC6300BC04E46883944D0C38BCDA6A02"
    }
  ],
  "markData": {
    "markResult": "2",
    "markTag": [
      "130"
    ]
  }
}

Request Signature

Send the Base64-encoded HMAC-SHA256 signature in the Authorization header. This callback uses the complete configured CallbackUrl in the signing string.

  1. Encode the exact JSON request body in UTF-8, compute SHA-256, and encode the digest as a hexadecimal string:

    CanonicalizedQueryString = hex(sha256(jsonBody))
    
  2. Join these components with an ASCII newline (\n):

    StringToSign = HTTPMethod + "\n"
                 + CallbackUrl + "\n"
                 + CanonicalizedQueryString + "\n"
                 + "X-AppId:" + SAME_APPID_IN_HEADER + "\n"
                 + "X-TimeStamp:" + SAME_TIMESTAMP_IN_HEADER
    
    Signing Parameter Value
    HTTPMethod POST
    CallbackUrl Complete URL configured for Annotation API Callback
    SAME_APPID_IN_HEADER Exact value of the X-AppId header
    SAME_TIMESTAMP_IN_HEADER Exact value of the X-TimeStamp header
  3. Compute HMAC-SHA256 over StringToSign using secretKey, then Base64-encode the result and send it in Authorization.