### Construct Full Request URL for Baidu Translation API Source: https://fanyi-api.baidu.com/doc/23 This example shows how to construct the complete URL for a GET request to the Baidu Translation API, including all necessary parameters and the generated signature. Remember to URL-encode the 'q' parameter before appending it to the URL to avoid signature errors. ```text https://fanyi-api.baidu.com/api/trans/vip/translate?q=apple&from=en&to=zh&appid=2015063000000001&salt=65478&sign=a1a7461d92e5194c5cae3182b5b24de1 ``` -------------------------------- ### Example Signature Calculation Source: https://fanyi-api.baidu.com/doc/24 Shows the step-by-step calculation of the MD5 signature using the provided parameters and secret key. ```text Step1. 拼接字符串1: 拼接appid=2015063000000001+q=amyotrophic lateral sclerosis+salt=1435660288+domain=medicine+密钥=12345678得到字符串1:“2015063000000001amyotrophic lateral sclerosis1435660288medicine12345678” Step2. 计算签名:(对字符串1做md5加密) sign=md5(2015063000000001amyotrophic lateral sclerosis1435660288medicine12345678),得到sign=a649f9a644b25d717beee5ce600b40ae ``` -------------------------------- ### Query Quote Progress Request Example Source: https://fanyi-api.baidu.com/doc/22 This JSON object shows a request to query the progress of a document quote task using a file ID. ```json { "fileId":"fcf6db042e1d65d756fac8d983c4a415" } ``` -------------------------------- ### Signature Calculation Example Source: https://fanyi-api.baidu.com/doc/27 This Python-like pseudocode demonstrates how to calculate the X-Sign header for API requests. It involves base64 encoding the audio, concatenating parameters, and then using HMAC-SHA256 with a secret key. ```python appid = '2015063000000001' # 请替换为您的APP ID timestamp = '1646034877' # 10位Unix时间戳 voice_bytes = b'00010101011101010101' secret_key = 'XWG7Gyj' # 翻译开放平台分配的密钥 # step1: base64编码音频文件 voice = base64encode(voice_bytes) # step2: 得到待加密的字符串 msg = appid + timestamp + voice # step3: 加密得到签名,作为`X-Sign`。 若hmac得到的是二进制字节,需要进行base64编码 sign = base64encode(hmac_sha256(secret= secret_key, message= msg)) ``` -------------------------------- ### Example Request Parameters for Domain Translation Source: https://fanyi-api.baidu.com/doc/24 Illustrates the required parameters for a domain-specific translation request, including query, languages, app ID, salt, domain, and the generated sign. ```text q=amyotrophic lateral sclerosis from=en to=zh appid=2015063000000001(请替换为您的appid) salt=1435660288(随机码) domain=medicine 平台分配的密钥: 12345678 ``` -------------------------------- ### Document Translation Request Example Source: https://fanyi-api.baidu.com/doc/22 This JSON object represents a sample request for document translation, specifying source and target languages, input file details, and output format. ```json { "from": "en", "to": "zh", "input": { "content": "6L+Z5piv5LiA5Liq5rWL6K+V5paH5Lu2", "fileId" :"", "format": "txt", "filename": "test.txt" "transImage": "0" }, "output":{ "format" : "txt" } } ``` -------------------------------- ### Voice Translation API Request Body Example Source: https://fanyi-api.baidu.com/doc/27 This is an example of the JSON body for a voice translation API request. Ensure 'voice' is base64 encoded and 'format' matches the audio file type. ```json { "from": "en", "to": "zh", "format":"pcm", "voice": "W3NvdXJjZSBhdWRpbyBieXRlc10K" } ``` -------------------------------- ### Query Translation Progress Request Example Source: https://fanyi-api.baidu.com/doc/22 This JSON object demonstrates a request to query the progress of an asynchronous translation task using a request ID. ```json { "requestId":123456 } ``` -------------------------------- ### Successful Translation Response Source: https://fanyi-api.baidu.com/doc/24 Example JSON output for a successful domain translation request, showing the source and translated text. ```json { "from": "en", "to": "zh", "trans_result": [ { "src": "amyotrophic lateral sclerosis", "dst": "肌萎缩性侧束硬化症" } ] } ``` -------------------------------- ### Callback Parameter Encryption Example Source: https://fanyi-api.baidu.com/doc/22 This snippet illustrates the encryption method for callback parameters, involving sorting parameters, HMAC-SHA256 encryption, and Base64 encoding to generate the 'sign' parameter. ```text appid=2015063000000001(请替换为您的appid) timestamp=1646034877(10位时间戳) 平台分配的密钥 seckey= 12345678 返回内容包含: { "code":0, "msg":"success", "requestId":123456, "notifyType":"trans", "amount":100, "charCount":100, "fileSrcUrl":"xxxxx", "lastFreeCharCount":100, "timestamp":1680257791, "sign":"xxxxxx" } # 加密过程 Step1: 除了sign之外其他参数排序 { "amount":100, "charCount":100, "code":0, "fileSrcUrl":"xxxxx", "lastFreeCharCount":100, "msg":"success", "notifyType":"trans", "requestId":123456, "timestamp":1680257791 } 字符串1 = amount=100&charCount=100&code=0&fileSrcUrl=xxxxx&lastFreeCharCount=100&msg=success¬ifyType=trans&requestId=123456×tamp=1680257791 Step2: 字符串2 = hash_hmac('sha256', '字符串1', '12345678') Step3: 对字符串2 做base64编码得到sign参数。 ``` -------------------------------- ### Translate Text using API Key Source: https://fanyi-api.baidu.com/doc/21 Example of how to call the AI Text Translation API using cURL with API Key authentication. Ensure you replace YOUR_API_KEY and YOUR_APPID with your actual credentials. ```curl curl -X POST "https://fanyi-api.baidu.com/ait/api/aiTextTranslate" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "appid": "YOUR_APPID", "from": "zh", "to": "en", "q": "你好" }' ``` -------------------------------- ### Successful Translation Response Source: https://fanyi-api.baidu.com/doc/21 Example of a successful JSON response from the AI Text Translation API, showing the translated text. ```json { "from": "en", "to": "zh", "trans_result": [ { "src": "apple", "dst": "苹果" } ] } ``` -------------------------------- ### Successful Language Detection Response Source: https://fanyi-api.baidu.com/doc/25 Example of a successful JSON response from the language detection API, indicating the detected language code. ```json { "error_code": 0, "error_msg": "success", "data": { "src": "en" } } ``` -------------------------------- ### Asynchronous Translation Service Encryption Example Source: https://fanyi-api.baidu.com/doc/22 This snippet demonstrates the encryption process for asynchronous translation requests, including the construction of request bodies and signature generation using HMAC-SHA256 and Base64 encoding. ```text appid=2015063000000001(请替换为您的appid) timestamp=1646034877(10位时间戳) 平台分配的密钥 seckey= 12345678 json串: { "from": "en", "to": "zh", "input": { "content": "6L+Z5piv5LiA5Liq5rWL6K+V5paH5Lu2", "fileId" :"xxxxx", "format": "txt", "filename": "test.txt" }, "output":{ "format" : "txt" } } # 加密过程 Step1. 字符串1 = { "from": "en", "to": "zh", "input": { "content": "6L+Z5piv5LiA5Liq5rWL6K+V5paH5Lu2", "fileId" :"xxxxx", "format": "txt", "filename": "test.txt" }, "output":{ "format" : "txt" } } 备注:字符串1就是http中body的数据 Step2. 字符串2 = 20150630000000011646034877{ "from": "en", "to": "zh", "input": { "content": "6L+Z5piv5LiA5Liq5rWL6K+V5paH5Lu2", "fileId" :"xxxxx", "format": "txt", "filename": "test.txt" }, "output":{ "format" : "txt" } } Step3. 字符串3 = hash_hmac('sha256', '字符串2', '12345678') Step4. X-Sign = base64encode(字符串3) = 0e0+HaVmzVJYuSgf6SmG/1hM+v3ItGEPva8ACw/jiXs= ``` -------------------------------- ### Baidu Image Translation API Response Example Source: https://fanyi-api.baidu.com/doc/26 This JSON structure represents a successful response from the Baidu Image Translation API after processing an image. It includes translation details for detected text, bounding boxes, and confidence scores. ```json { "error_code":"0", "error_msg":"success", "data":{ "from":"zh", "to":"en", "content":[ { "src":"这是一个测试 ", "dst":"This is a test.", "rect":"79 23 246 43", "lineCount":1, "pasteImg":"xxx", "points":[ { "x":0, "y":0 }, { "x":0, "y":0 }, { "x":20, "y":20 }, { "x":10, "y":10 } ] }, { "src":"这是一个例子 ", "dst":"This is an example.", "rect":"79 122 201 37", "lineCount":1, "pasteImg":"xxx", "points":[ { "x":50, "y":50 }, { "x":50, "y":50 }, { "x":20, "y":20 }, { "x":10, "y":10 } ] } ], "sumSrc":"这是一个测试 这是一个例子 ", "sumDst":"This is a test. This is an example.", "pasteImg":"xxx" } } ``` -------------------------------- ### Error Response for Invalid Signature Source: https://fanyi-api.baidu.com/doc/25 Example of a JSON response indicating an error, specifically when the provided signature is invalid. ```json { "error_code": "54001", "error_msg": "Invalid Sign" } ``` -------------------------------- ### Signature Generation Method Source: https://fanyi-api.baidu.com/doc/24 Demonstrates the process of generating a secure signature for API requests by concatenating parameters and applying MD5 hashing. ```text Step1. 将请求参数中的 APPID(appid)、翻译query(q,注意为UTF-8编码)、随机数(salt)、支持翻译领域(domain)以及平台分配的密钥(可在管理控制台查看) 按照**appid+q+salt+domain+密钥** 的顺序拼接得到字符串1。 Step2. 对字符串1做md5,得到32位小写的sign。 ``` -------------------------------- ### HMAC-SHA256 Signing Method Steps Source: https://fanyi-api.baidu.com/doc/22 Outlines the four steps to generate an HMAC-SHA256 signature for API requests, involving body content, app ID, timestamp, and base64 encoding. ```text Step1 : 传入http请求中的body(原始json串,保留原始格式)字符串作为`字符串1`。(注意部分语言需确保字符串为UTF-8编码) Step2. 将 APPID(X-Appid),时间戳(X-Timestamp), `字符串1`,按照APPID+时间戳+`字符串1`顺序拼接得到`字符串2`。 Step3. 对`字符串2` 做hmac_sha256加密,密钥使用平台分配的密钥(可在管理控制台查看) 得到`字符串3`。 Step4. 对`字符串3` 做base64编码得到X-Sign。 ``` -------------------------------- ### Signature Generation for Language Detection API Source: https://fanyi-api.baidu.com/doc/25 Demonstrates the process of generating a signature for secure API requests. This involves concatenating specific parameters and a secret key, then applying an MD5 hash. ```text Step1. 拼接字符串1: 拼接appid=2015063000000001+q=apple+salt=1435660288+密钥=12345678得到字符串1:“2015063000000001apple143566028812345678” Step2. 计算签名:(对字符串1做md5加密) sign=md5(2015063000000001apple143566028812345678),得到sign=f89f9594663708c1605f3d736d01d2d4 ``` -------------------------------- ### Generate MD5 Signature for Baidu Translation API Source: https://fanyi-api.baidu.com/doc/23 This snippet demonstrates how to generate the authentication signature required for API requests. It involves concatenating appid, query, salt, and appkey, then applying an MD5 hash. Ensure the query parameter is UTF-8 encoded before sending the request. ```python # 示例:将英文单词 apple 翻译成中文 # 输入参数 q = 'apple' # 待翻译文本,utf-8编码 from = 'en' # 原文语言代码 to = 'zh' # 译文语言代码 appid = '2015063000000001' # 请替换为您的appid salt = '65478' # 函数生成的随机码 appkey = '1234567890' # 请替换为您的密钥 needIntervene = 0 # 调用术语库,可选参数 # 生成签名sign sign_str = appid + q + salt + appkey # 得到字符串'2015063000000001apple654781234567890' sign = md5(sign_str) # 对字符串做md5加密,注意需32位小写,即结果为'a1a7461d92e5194c5cae3182b5b24de1' ``` -------------------------------- ### Baidu Translation API Successful Response Example Source: https://fanyi-api.baidu.com/doc/23 This JSON object represents a successful response from the Baidu General Text Translation API. It includes the source and target languages, and the translation result with original and translated text. ```json { "from": "en", "to": "zh", "trans_result": [ { "src": "apple", "dst": "苹果" } ] } ``` -------------------------------- ### 领域翻译API Source: https://fanyi-api.baidu.com/doc/24 领域翻译API通过HTTP接口对外提供多语种互译服务。您只需要通过调用领域翻译API,传入待翻译的内容,并指定要翻译的源语言(支持源语言语种自动检测)和目标语言种类,就可以得到相应的翻译结果。 ```APIDOC ## 领域翻译API HTTPS地址 ``` https://fanyi-api.baidu.com/api/trans/vip/fieldtranslate ``` ### 输入参数 | 字段名 | 类型 | 是否必填 | 描述 | 备注 | |---|---|---|---|---| | q | text | 是 | 请求翻译query | UTF-8编码 | | from | text | 是 | 翻译源语言 | 可设置为auto | | to | text | 是 | 翻译目标语言 | 不可设置为auto | | appid | text | 是 | APPID | 可在管理控制台查看 | | salt | text | 是 | 随机数 | 可为字母或数字的字符串 | | domain | text | 是 | 翻译领域类型 | 具体见下表 | | sign | text | 是 | 签名 | appid+q+salt+domain+密钥的MD5值 | | needIntervene | integer | 否 | 判断是否需要使用自定义术语干预API | 1-是,0-否 | **domain领域支持范围:** | 支持传入值 | 描述 | 支持语言方向 | |---|---|---| | it | 信息技术领域 | 中文(简)-> 英语、英语 -> 中文(简) | | finance | 金融财经领域 | 中文(简)-> 英语、英语 -> 中文(简) | | machinery | 机械制造领域 | 中文(简)-> 英语、英语 -> 中文(简) | | senimed | 生物医药领域 | 中文(简)-> 英语、英语 -> 中文(简) | | novel | 网络文学领域 | 中文(简)-> 英语 | | academic | 学术论文领域 | 中文(简)-> 英语、英语 -> 中文(简) | | aerospace | 航空航天领域 | 中文(简)-> 英语、英语 -> 中文(简) | | wiki | 人文社科领域 | 中文(简)-> 英语 | | news | 新闻资讯领域 | 中文(简)-> 英语、英语 -> 中文(简) | | law | 法律法规领域 | 中文(简)-> 英语、英语 -> 中文(简) | | contract | 合同领域 | 中文(简)-> 英语、英语 -> 中文(简) | * **请求方式:** 可使用GET或POST方式,如使用POST方式,Content-Type请指定为:application/x-www-form-urlencoded * **字符编码:** 统一采用UTF-8编码格式 * **query长度:** 为保证翻译质量,请将单次请求长度控制在 6000 字节以内(汉字约为2000个) ### 签名生成方法 签名是为了保证调用安全,使用MD5算法生成的一段字符串,生成的签名长度为32位,签名中的英文字符均为小写格式。 ### 生成方法: * Step1. 将请求参数中的 APPID(appid)、翻译query(q,注意为UTF-8编码)、随机数(salt)、支持翻译领域(domain)以及平台分配的密钥(可在管理控制台查看) 按照**appid+q+salt+domain+密钥** 的顺序拼接得到字符串1。 * Step2. 对字符串1做md5,得到32位小写的sign。 注: 1. 待翻译文本(q)需为UTF-8编码; 2. 在生成签名拼接appid+q+salt+密钥字符串时,q不需要做URL encode,在生成签名之后,发送HTTP请求之前才需要对要发送的待翻译文本字段q做URL encode; 3. 科技电子、水利机械、网络文学三个领域仅支持中到英,如设置语言方向为英到中,则默认输出通用翻译结果;生物医药、金融财经领域可支持中到英和英到中两种语言方向。 4. 如遇到报 54001 签名错误,请检查您的签名生成方法是否正确,在对 sign 进行拼接和加密时,q 不需要做 URL encode,很多开发者遇到签名报错均是由于拼接 sign 前就做了 URL encode; ### 输出参数 返回的结果是json格式,包含以下字段: | 字段名 | 类型 | 描述 | 备注 | |---|---|---|---| | from | string | 源语言 | 返回用户指定的语言,或者自动检测出的语种(源语言设为 auto 时) | | to | string | 目标语言 | 返回用户指定的目标语言 | | trans_result | mixed list | 翻译结果 | 返回翻译结果,包括 src 和 dst 字段 | | trans_result.*.src | string | 原文 | 接入举例中的“amyotrophic lateral sclerosis” | | trans_result.*dst | string | 译文 | 接入举例中的“肌萎缩性侧束硬化症” | | error_code | integer | 错误码 | 仅当出现错误时显示 | ### 接入举例 例如:将英文单词amyotrophic lateral sclerosis翻译成肌萎缩性侧束硬化症,生物医药领域: ### 请求参数: ```      q=amyotrophic lateral sclerosis      from=en      to=zh      appid=2015063000000001(请替换为您的appid)      salt=1435660288(随机码)      domain=medicine      平台分配的密钥: 12345678 ``` ### 生成签名sign: Step1. 拼接字符串1: 拼接appid=2015063000000001+q=amyotrophic lateral sclerosis+salt=1435660288+domain=medicine+密钥=12345678得到字符串1:“2015063000000001amyotrophic lateral sclerosis1435660288medicine12345678” Step2. 计算签名:(对字符串1做md5加密) sign=md5(2015063000000001amyotrophic lateral sclerosis1435660288medicine12345678),得到sign=a649f9a644b25d717beee5ce600b40ae ### 拼接完整请求: ``` https://fanyi-api.baidu.com/api/trans/vip/fieldtranslate?q=amyotrophic+lateral+sclerosis&from=en&to=zh&appid=2015063000000001&salt=1435660288&domain=medicine&sign=a649f9a644b25d717beee5ce600b40ae ``` 注:也可使用POST方式,如POST方式传送,Content-Type请指定为:application/x-www-form-urlencoded ### 输出举例 **正确情况:** ```json { "from": "en", "to": "zh", "trans_result": [ { "src": "amyotrophic lateral sclerosis", "dst": "肌萎缩性侧束硬化症" } ] } ``` ### 异常情况: ```json { "error_code": "54001", "error_msg": "Invalid Sign" } ``` ``` -------------------------------- ### 异步报价服务正常响应示例 Source: https://fanyi-api.baidu.com/doc/22 当异步报价服务请求成功时,会返回此格式的响应。'code'为0表示成功,'data.fileId'是用于后续匹配报价服务异步回调的唯一标识。 ```json { "code": 0, "msg": "success", "data": { "fileId" :"fcf6db042e1d65d756fac8d983c4a415" } } ``` -------------------------------- ### 异步报价服务请求参数示例 Source: https://fanyi-api.baidu.com/doc/22 此示例展示了如何构建一个用于获取文档翻译报价的请求体。请确保'content'字段包含文档文件的base64编码,并根据实际情况填写'format'和'filename'。 ```json { "from": "en", "to": "zh", "input": { "content": "6L+Z5piv5LiA5Liq5rWL6K+V5paH5Lu2", "format": "txt", "filename": "test.txt" "transImage": "0" } } ``` -------------------------------- ### 图片翻译API请求URL示例 Source: https://fanyi-api.baidu.com/doc/26 此示例展示了如何构建一个图片翻译API的请求URL,包含了必要的查询参数。 ```text https://fanyi-api.baidu.com/api/trans/sdk/picture?from=zh&to=en&appid=20180905000111111&salt=1435660288&sign=bf7303b9be4191726f62c19115c9a165&cuid=APICUID&mac=mac&version=3 ``` -------------------------------- ### Query Quote Progress Success Response Source: https://fanyi-api.baidu.com/doc/22 A successful response when querying quote progress, providing file details, status, and cost information. ```json { "code": 0, "msg": "success", "data": { "fileId" : "fcf6db042e1d65d756fac8d983c4a415", "status" : 1, "charCount" : 1000, "amount" : 100, "lastFreeCharCount" : 1000 } } ``` -------------------------------- ### 大模型文本翻译 API Source: https://fanyi-api.baidu.com/doc/21 调用百度大模型文本翻译API进行文本翻译。支持选择翻译模型、自定义术语库、翻译指令和标签保持等功能。 ```APIDOC ## POST https://fanyi-api.baidu.com/ait/api/aiTextTranslate ### Description 调用百度大模型文本翻译API进行文本翻译。支持选择翻译模型、自定义术语库、翻译指令和标签保持等功能。 ### Method POST ### Endpoint https://fanyi-api.baidu.com/ait/api/aiTextTranslate ### Parameters #### Query Parameters - **appid** (string) - Required - APPID - **q** (string) - Required - 请求翻译query (UTF-8编码,上限为6000字符) - **from** (string) - Required - 翻译源语言 (可设置为auto) - **to** (string) - Required - 翻译目标语言 (不可设置为auto) - **needIntervene** (integer) - Optional - 判断是否需要使用自定义术语干预API (1-是,0-否) - **model_type** (string) - Optional - 选择翻译模型 ('llm'-大模型翻译(默认值),'nmt'-机器翻译) - **reference** (string) - Optional - 自定义翻译指令 (可填写对翻译结果的要求,如“使用学术风格来翻译”) - **tag_handling** (integer) - Optional - 标签保持功能,开启后<>尖括号标签会在译文中保留 (1-开,0-关(默认值);当前仅支持model_type = 'nmt') - **ignore_tags** (array) - Optional - 自定义标签间内容不翻译,可传入最多20个标签,如:[‘name’, ‘address’] (仅在 model_type = 'nmt',且 tag_handling = 1 时生效) - **salt** (string) - Optional - 随机数 (使用sign鉴权需填写,可为字母或数字的字符串) - **sign** (string) - Required - 签名 (使用sign鉴权需填写,appid+q+salt+密钥的MD5值) ### Request Example ```json { "appid": "YOUR_APPID", "from": "zh", "to": "en", "q": "你好" } ``` ### Response #### Success Response (200) - **from** (string) - 翻译源语言 - **to** (string) - 翻译目标语言 - **trans_result** (array) - 翻译结果列表 - **src** (string) - 原始文本 - **dst** (string) - 翻译后文本 #### Error Response - **error_code** (string) - 错误码 - **error_msg** (string) - 错误信息 #### Response Example ```json { "from": "en", "to": "zh", "trans_result": [ { "src": "apple", "dst": "苹果" } ] } ``` ``` -------------------------------- ### 图片翻译API HTTPS地址 Source: https://fanyi-api.baidu.com/doc/26 这是图片翻译API的HTTPS访问地址。请确保使用此URL进行API请求。 ```text https://fanyi-api.baidu.com/api/trans/sdk/picture ``` -------------------------------- ### Complete Request URL for Language Detection Source: https://fanyi-api.baidu.com/doc/25 Constructs the full URL for a language detection API request, including all necessary parameters and the generated signature. ```text https://fanyi-api.baidu.com/api/trans/vip/language?q=apple&salt=1435660288&sign=f89f9594663708c1605f3d736d01d2d4&appid=2015063000000001 ``` -------------------------------- ### Query Quote Progress Source: https://fanyi-api.baidu.com/doc/22 Queries the asynchronous quoting progress. This is a synchronous interface that returns the current quoting status. ```APIDOC ## POST /transapi/doctrans/query/quote ### Description Queries the asynchronous quoting progress. This is a synchronous interface that returns the current quoting status. This service is free of charge. ### Method POST ### Endpoint https://fanyi-api.baidu.com/transapi/doctrans/query/quote ### Parameters #### Request Body - **fileId** (string) - Required - File ID. ### Request Example ```json { "fileId":"fcf6db042e1d65d756fac8d983c4a415" } ``` ### Response #### Success Response (200) - **code** (int) - Error code: 0 for success, non-zero for failure. - **msg** (string) - Success or error message. - **data** (object) - Request result dataset, present only when `code` is 0. - **data.fileId** (string) - File ID. - **data.status** (int) - Status: 0 - Task parsing; 1 - Task completed; 2 - Task failed (file parsing failed). - **data.charCount** (int) - Character count of the file. - **data.amount** (int) - Pre-deducted amount. - **data.from** (string) - Original language of the document. - **data.lastFreeCharCount** (int) - Remaining free character count. #### Response Example ```json { "code": 0, "msg": "success", "data": { "fileId" : "fcf6db042e1d65d756fac8d983c4a415", "status" : 1, "charCount" : 1000, "amount" : 100, "lastFreeCharCount" : 1000 } } ``` #### Error Response Example ```json { "code": 10005, "msg": "Sign fail" } ``` ``` -------------------------------- ### 异步报价服务回调示例 Source: https://fanyi-api.baidu.com/doc/22 当报价服务完成时,会通过配置的回调接口推送此格式的数据。包含任务文件ID、通知类型、报价金额、字符数、剩余免费字符量和签名等信息。 ```json { "code": 0, "msg": "success", "fileId": "fcf6db042e1d65d756fac8d983c4a415", "notifyType": "quote", "amount": 100, "charCount": 10, "lastFreeCharCount": 40000, "timestamp": 1680257791, "sign": "xxxx", "from": "en" } ```