Feedback API

Submit positive or negative feedback on a translation. Feedback is used for translation evaluation and model improvement. View the statistics in the corresponding project’s Data Statistics page.

POSThttps://translate.ilivedata.com/api/v2/translate/feedback

Request Parameters

Request Headers

All headers below are required.

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

Request Body

Parameter Type Required Description
source String Yes Source language code from Language Support.
target String Yes Target language code from Language Support.
sourceText String Yes Original text
targetText String Yes Translated text
feedback Int Yes Rating: 0 for negative, 1 for positive
userId String No Recipient ID
note String No Additional comments

Request Example

{"source":"en","target":"zh-CN","sourceText":"hello world","targetText":"世界你好","feedback":1,"userId":"119156631"}

Request Signature

Use your project’s secretKey to calculate Authorization according to Request Signature. The API returns HTTP 401 if the signature does not match or the project does not have permission.

Build the Body Hash

For this JSON request, calculate the SHA-256 hash of the exact UTF-8 request body and encode it as a hexadecimal string:

CanonicalizedQueryString = hex(sha256(jsonBody))

Whitespace and line breaks affect the hash. Send exactly the same body bytes that you sign.

Build the String to Sign

StringToSign = HTTPMethod + "\n" +
               HostHeaderInLowercase + "\n" +
               HTTPRequestURI + "\n" +
               CanonicalizedQueryString + "\n" +
               "X-AppId:" + SAME_APPID_IN_HEADER + "\n" +
               "X-TimeStamp:" + SAME_TIMESTAMP_IN_HEADER
Signature Component Value
HTTPMethod POST
HostHeaderInLowercase translate.ilivedata.com
HTTPRequestURI /api/v2/translate/feedback

HTTPRequestURI does not include query parameters. Use the same project ID and timestamp in the signature and request headers.

Calculate Authorization

Calculate the HMAC-SHA256 digest of StringToSign using secretKey as the key. Base64-encode the digest and set it as the Authorization header.

Signature Example

For the single-line JSON request body above, with no trailing newline, the body hash is:

4cda21d24c896ffef1520c850636eb3601733a2939fa1ab1842d3a4ac9aed5cd

With X-AppId: 1000 and X-TimeStamp: 2026-09-30T02:30:00Z, the string to sign is:

POST
translate.ilivedata.com
/api/v2/translate/feedback
4cda21d24c896ffef1520c850636eb3601733a2939fa1ab1842d3a4ac9aed5cd
X-AppId:1000
X-TimeStamp:2026-09-30T02:30:00Z

Calculate the signature using your actual secret key. Replace the project ID and timestamp with actual values and recalculate the signature before sending a request.

HTTP Response

Content-Type: application/json;charset=UTF-8

Response Fields

Field Type Description
errorCode Number Error code; 0 indicates success
errorMessage String Error message

Response Example

{
  "errorCode": 0,
  "errorMessage": "OK"
}