上传
接口名称:uploadTranslate
接口完整路径:https://www.fanyigou.com/TranslateApi/api/uploadTranslate
接口说明:用户调用接口进行 源文件上传,上传完成后会自动进行翻译,通过tid可以查询翻译的进度等数据。注意:
1.上传格式:pdf、Microsoft Office(doc、docx、dot、dotx、dotm、docm、xml、odt)、WPS Office(wps、wpt)、xls、xlsx、et、ett、ppt、pptx、dps、dpt、txt、rtf
2.上传文件最大50M(如有更高需求请联系销售)
3. 不支持图纸、纯图片文档,加密文件请先去除密码
4.翻译完成后按页从主账号里扣费
5.目前普通账户支持一条翻译通道(即只能同时进行一个文件的上传翻译),(如有更高需求请联系销售)
调用说明:请求方式:post, file参数请以 multipart/form-data 方式的表单 POST 提交
入参列表:
参数名称 | 参数说明 | 参数类型 | 备注 | 是否必填 |
---|---|---|---|---|
appid | 应用的唯一识别标记 | String | 是 | |
token | 签名 | String | 见token生成规则 | 是 |
nonce_str | 随机字符串 | String | 是 | |
from | 源语言 | String | 见语言列表 | 是 |
to | 目标语言(不支持自动检测) | String | 见语言列表 | 是 |
md5 | 源文件md5 | String | md5小写 | 是 |
industryId | 行业代码 | int | 见行业列表 | 否 |
transImg | 文档内图片翻译 | int | 0:不翻译文档内图片(默认),1:翻译文档内图片。目前支持中、英、日、韩的文档内图片翻译。(如有需要请联系销售开通) | 否 |
excelMode | 指定excel翻译模式 | int | 0:只翻译当前打开sheet(默认),1:翻译全部sheet(页数按全部sheet字符数来计算) | 否 |
bilingualControl | 指定翻译模式 | int | 0:译文单独为一个文档(默认),1:双语对照(原文和译文在一个文档) | 否 |
出参列表:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
code | 状态码 | int | 详见状态码列表 |
msg | 返回状态说明 | String | |
data | 返回数据结果集 | String | Json字符串 |
data结果集:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
tid | 翻译id | String | 通过该id可查询翻译进度等 |
返回结果:
{"code": 100,"data": {"tid": 14587},"msg": "请求成功"}
下载
接口名称:downloadFile
接口完整路径:https://www.fanyigou.com/TranslateApi/api/downloadFile
接口说明:根据tid下载文档(任务完成才能下载)
入参列表:
参数名称 | 参数说明 | 参数类型 | 备注 | 是否必填 |
---|---|---|---|---|
appid | 应用的唯一识别标记 | String | 是 | |
token | 签名 | String | 见token生成规则 | 是 |
nonce_str | 随机字符串 | String | 是 | |
dtype | 下载的文件类型(new):
2:翻译后的pdf文件,支持格式:word、pdf、img。 3:翻译后的word文件(支持格式:word、pdf);ppt文件(支持格式:img、ppt);excel文件(支持格式:excel) 6:转换完成文档 | int | 是 | |
tid | 查询状态结果Id | int | 上传源文件后可获取该ID | 是 |
出参列表:
说明:1.判断Response Headers 中 detectLanguage 的值,若存在且不为空即为自动检测出的语言(可能为多种语言),仅供参考
2.判断Response Headers 中Content-Type 的值,若包含"application/octet-stream" 则可直接进行下载,否则即为以下返回值
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
code | 状态码 | int | 详见状态码列表 |
msg | 返回状态说明 | String |
返回结果:
{"code": 312,"msg": "该翻译不存在"}
获取进度
接口名称:queryTransProgress
接口完整路径:https://www.fanyigou.com/TranslateApi/api/queryTransProgress
接口说明:提交翻译完成后可调用此接口实时查询翻译进度或检测页数进度
入参列表:
参数名称 | 参数说明 | 参数类型 | 备注 | 是否必填 |
---|---|---|---|---|
appid | 应用的唯一识别标记 | String | 是 | |
token | 签名 | String | 见token生成规则 | 是 |
nonce_str | 随机字符串 | String | 是 | |
tid | 查询状态结果Id | int | 是 |
出参列表:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
code | 状态码 | int | 详见状态码列表 |
msg | 返回状态说明 | String | |
data | 返回数据结果集 | String | Json字符串 |
data结果集:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
tid | 查询翻译id | int | 通过该id可查询翻译进度等 |
title | 文件名 | String | |
docType | 文件类型 | String | |
fromLan | 源语言 | String | |
toLan | 目标语言 | String | |
detectLan | 翻译进度 | String | 不为空即为自动检测出的主要语言,仅供参考 |
percent | 进度 | String | |
pageCount | 文件页数 | int | |
status | 状态 | int | 详见文件状态码,314为翻译完成,330为检测页数完成 |
msg | 状态说明 | String | |
createTime | 创建时间 | String | |
updateTime | 更新时间 | String |
返回结果:
{ "code": 100, "data": { "createTime": "2018-03-27 16:57:51", "docType": "docx", "fromLan": "", "msg": "正在翻译", "pageCount": 1, "percent": "99.00", "status": 313, "tid": 14587, "title": "测试", "toLan": "中文", "updateTime": "2018-03-27 16:58:00" }, "msg": "请求成功" }
上传文件检测页数
接口名称:detectDocPage
接口完整路径:https://www.fanyigou.com/TranslateApi/api/detectDocPage
接口说明:用户调用接口进行 源文件上传,上传完成后可调用查询进度接口查询页数。注意:
1.上传格式:pdf、Microsoft Office(doc、docx、dot、dotx、dotm、docm、xml、odt)、WPS Office(wps、wpt)、xls、xlsx、et、ett、ppt、pptx、dps、dpt、txt、rtf
2.上传文件最大50M(如有更高需求请联系销售)
3.不支持图纸、纯图片文档,加密文件请先去除密码
4.该功能需联系客服开通
调用说明:请求方式:post, file参数请以 multipart/form-data 方式的表单 POST 提交
入参列表:
参数名称 | 参数说明 | 参数类型 | 备注 | 是否必填 |
---|---|---|---|---|
appid | 应用的唯一识别标记 | String | 是 | |
token | 签名 | String | 见token生成规则 | 是 |
nonce_str | 随机字符串 | String | 是 | |
md5 | 源文件md5 | String | md5小写 | 是 |
出参列表:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
code | 状态码 | int | 详见状态码列表 |
msg | 返回状态说明 | String | |
data | 返回数据结果集 | String | Json字符串 |
data结果集:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
tid | 翻译id | int | 通过该id可查询任务进度等 |
page | 检测到的页数 | int | 检测页数(大于0即检测成功,等于0则转入后台检测,需要调用进度接口查询页数,返回页数大于0即为成功) |
返回结果:
{"code": 100,"data": {"tid": 14587,"page",20},"msg": "请求成功"}
检测页数文件提交翻译
接口名称:submitForDetectDoc
接口完整路径:https://www.fanyigou.com/TranslateApi/api/submitForDetectDoc
接口说明:用户调用检测页数接口的文档提交翻译,注意:
同一个tid提交一次翻译即可。
调用说明:请求方式:get,post
入参列表:
参数名称 | 参数说明 | 参数类型 | 备注 | 是否必填 |
---|---|---|---|---|
appid | 应用的唯一识别标记 | String | 是 | |
token | 签名 | String | 见token生成规则 | 是 |
nonce_str | 随机字符串 | String | 是 | |
tid | 检测文档页数接口返回的tid | int | 是 | |
from | 源语言 | String | 见语言列表 | 是 |
to | 目标语言(不支持自动检测) | String | 见语言列表 | 是 |
industryId | 行业代码 | int | 见行业列表 | 否 |
transImg | 文档内图片翻译 | int | 0:不翻译文档内图片(默认),1:翻译文档内图片。目前支持中、英、日、韩的文档内图片翻译。(如有需要请联系销售开通) | 否 |
excelMode | 指定excel翻译模式 | int | 0:只翻译当前打开sheet(默认),1:翻译全部sheet(页数按全部sheet字符数来计算) | 否 |
bilingualControl | 指定翻译模式 | int | 0:译文单独为一个文档(默认),1:双语对照(原文和译文在一个文档) | 否 |
出参列表:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
code | 状态码 | int | 详见状态码列表 |
msg | 返回状态说明 | String | |
data | 返回数据结果集 | String | Json字符串 |
返回结果:
{"code": 100,"msg": "请求成功"}
文档转换
接口名称:convert
接口完整路径:https://www.fanyigou.com/TranslateApi/api/convert
接口说明:用户调用接口进行 源文件上传,上传完成后会自动进行转换,通过tid可以查询转换的进度等数据。注意:
1.上传格式:pdf、doc、docx、ppt、pptx、xls、xlsx、hwp、caj、ofd
2.上传文件最大50M (如有更高需求请联系销售)
3.加密文件请先去除密码
4.转换完成后按页从主账号里扣费
调用说明:请求方式:post, file参数请以 multipart/form-data 方式的表单 POST 提交
入参列表:
参数名称 | 参数说明 | 参数类型 | 备注 | 是否必填 |
---|---|---|---|---|
appid | 应用的唯一识别标记 | String | 是 | |
token | 签名 | String | 见token生成规则 | 是 |
nonce_str | 随机字符串 | String | 是 | |
from | 源文件的语言(扫描件需设置语言) | String | 见语言列表 | 否 |
conversionFormat | 转换的目标格式(目前支持pdf到其它格式的转换(excel,ppt,word,ofd),及其它格式(excel,ppt,word,hwp,caj,ofd)到pdf的转换) -1:word;-3:excel;-6:pptx,-8:pdf,-9:ofd。 | int | 是 | |
md5 | 源文件md5 | String | 是 |
出参列表:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
code | 状态码 | int | 详见状态码列表 |
msg | 返回状态说明 | String | |
data | 返回数据结果集 | String | Json字符串 |
data结果集:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
tid | 任务id | String | 通过该id可查询进度等 |
返回结果:
{"code": 100,"data": {"tid": 14587},"msg": "请求成功"}
回调通知
回调说明:翻译任务、转换任务,失败或成功时会发起回调
请求方式:post, application/json
目前回调地址需要后台设置,后续会开放设置
回调接口处理完成后须返回“success”字符串
回调参数列表:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
tid | 查询任务id | int | 通过该id可查询任务进度等 |
title | 文件名 | String | |
docType | 文件类型 | String | |
fromLan | 源语言 | String | |
toLan | 目标语言 | String | |
detectLan | 检测的语言 | String | 不为空即为自动检测出的主要语言,仅供参考 |
percent | 任务进度 | String | |
pageCount | 文件页数 | int | |
status | 任务状态 | int | 详见文件任务状态码 |
msg | 状态说明 | String | |
createTime | 创建时间 | String | |
updateTime | 更新时间 | String | |
type | 任务类型 | int | 1:文档翻译(默认),4:文档转换 |
回调JSON示例:
{ "createTime":"2021-08-25 14:27:47", "detectLan":"", "docType":"pdf", "fromLan":"中文", "msg":"完成", "pageCount":1, "percent":"100.00", "status":314, "tid":19432525, "title":"test", "toLan":"英语", "updateTime":"2021-08-25 14:27:47", "type":0 }
获取账户信息
接口名称:getAccount
接口完整路径:https://www.fanyigou.com/TranslateApi/api/getAccount
接口说明:获取账户信息
入参列表:
参数名称 | 参数说明 | 参数类型 | 备注 | 是否必填 |
---|---|---|---|---|
appid | 应用的唯一识别标记 | String | 是 | |
token | 签名 | String | 见token生成规则 | 是 |
nonce_str | 随机字符串 | String | 是 | |
type | 资源包类型 1.文档翻译 2.文字翻译 3.图片翻译 4.格式转换 | int | 默认值1 | 否 |
出参列表:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
code | 状态码 | int | 详见状态码列表 |
msg | 返回状态说明 | String | |
data | 返回数据结果集 | String | Json字符串 |
data结果集:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
deductType | 0:按积分计费,1:按页计费 | int | |
balance | 余额 | int |
返回结果:
{"code":100,"data":{"deductType":1,"balance":137684},"msg":"请求成功"}
文字翻译
接口名称:trans
接口完整路径:https://www.fanyigou.com/TranslateApi/api/trans
接口说明:
1.待翻译文本字符长度不能超过2000;
2.语言方向:英、日、俄、韩、德、法、意 到中;中、日、俄、韩、德、法、意 到英
调用说明:请求方式:post
入参列表:
参数名称 | 参数说明 | 参数类型 | 备注 | 是否必填 |
---|---|---|---|---|
appid | 应用的唯一识别标记 | String | 是 | |
token | 签名 | String | 见token生成规则 | 是 |
nonce_str | 随机字符串 | String | 是 | |
from | 源语言 | String | 是 | |
to | 目标语言 | String | 是 | |
text | 待翻译文本,需UTF-8编码 | String | 是 |
出参列表:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
code | 状态码 | int | 详见状态码列表 |
msg | 返回状态说明 | String | |
data | 返回数据结果集 | String | Json字符串 |
data结果集:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
msg | 状态说明 | String | |
transResult | 翻译译文 | String | |
status | 任务状态 | int |
返回结果:
{"code":0,"data":{"msg":"翻译成功","transResult":"Test text translation time ","status":314},"msg":"请求成功"}
图片上传
接口名称:uploadTranslateImage
接口完整路径:https://www.fanyigou.com/TranslateApi/api/image/uploadTranslateImage
接口说明:用户调用接口进行 源文件上传,上传完成后会自动进行翻译,通过tid可以查询翻译的进度等数据。注意:
1.上传格式:jpg、jpeg、png、bmp
2.上传文件最大4M
3.支持15*15 - 2048*2048px尺寸内
4.翻译完成后按页从主账号里扣费
调用说明:请求方式:post, file参数请以 multipart/form-data 方式的表单 POST 提交
入参列表:
参数名称 | 参数说明 | 参数类型 | 备注 | 是否必填 |
---|---|---|---|---|
appid | 应用的唯一识别标记 | String | 是 | |
token | 签名 | String | 见token生成规则 | 是 |
nonce_str | 随机字符串 | String | 是 | |
from | 源语言 | String | 见图片语言列表 | 是 |
to | 目标语言 | String | 见图片语言列表 | 是 |
md5 | 源文件md5 | String | md5小写 | 是 |
出参列表:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
code | 状态码 | int | 详见状态码列表 |
msg | 返回状态说明 | String | |
data | 返回数据结果集 | String | Json字符串 |
data结果集:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
taskId | 翻译id | String | 通过该id可查询翻译进度等 |
返回结果:
{"code": 100,"data": {"taskId": 14587},"msg": "请求成功"}
图片翻译获取进度
接口名称:queryImageTransProgress
接口完整路径:https://www.fanyigou.com/TranslateApi/api/image/queryImageTransProgress
接口说明:提交翻译完成后可调用此接口实时查询翻译进度或检测页数进度
入参列表:
参数名称 | 参数说明 | 参数类型 | 备注 | 是否必填 |
---|---|---|---|---|
appid | 应用的唯一识别标记 | String | 是 | |
token | 签名 | String | 见token生成规则 | 是 |
nonce_str | 随机字符串 | String | 是 | |
tid | 查询状态结果Id | int | 是 |
出参列表:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
code | 状态码 | int | 详见状态码列表 |
msg | 返回状态说明 | String | |
data | 返回数据结果集 | String | Json字符串 |
data结果集:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
fromLan | 源语言 | String | |
toLan | 目标语言 | String | |
detectLan | 检测的语言 | String | 不为空即为自动检测出的主要语言,仅供参考 |
percent | 任务进度 | String | |
pageCount | 文件页数 | int | |
status | 任务状态 | int | 详见文件状态码,314为翻译完成,330为检测页数完成 |
msg | 状态说明 | String | |
createTime | 创建时间 | String | |
updateTime | 更新时间 | String |
返回结果:
{ "msg": "请求成功", "code": 100, "data": { "tid": 13417, "createTime": "2022-10-26 11:21:02", "updateTime": "2022-10-26 11:30:35", "status": 0, "title": "5120791b2f0967b54e057dd8af5d87e", "pageCount": 1, "percent": "100.00", "fromLan": "中文","detectLan": "", "toLan": "英语", "docType": "png", "msg": "翻译成功", "originalCharCount": 0 } }
图片翻译下载
接口名称:downloadImage
接口完整路径:https://www.fanyigou.com/TranslateApi/api/image/downloadImage
接口说明:根据tid下载文档(任务完成才能下载)
入参列表:
参数名称 | 参数说明 | 参数类型 | 备注 | 是否必填 |
---|---|---|---|---|
appid | 应用的唯一识别标记 | String | 是 | |
token | 签名 | String | 见token生成规则 | 是 |
nonce_str | 随机字符串 | String | 是 | |
tid | 查询状态结果Id | int | 上传源文件后可获取该ID | 是 |
出参列表:
说明:1.判断Response Headers 中Content-Type 的值,若包含"application/octet-stream" 则可直接进行下载,否则即为以下返回值
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
code | 状态码 | int | 详见状态码列表 |
msg | 返回状态说明 | String |
返回结果:
{"code": 312,"msg": "该翻译不存在"}
OCR上传
接口名称:ocrUploadImage
接口完整路径:https://www.fanyigou.com/TranslateApi/api/image/ocrUploadImage
接口说明:用户调用接口进行 源文件上传,上传完成后会自动进行识别并返回数据。注意:
1.上传格式:jpg、jpeg、png、bmp
2.上传文件最大4M
3.支持15*15 - 8192*8192px尺寸内
4.翻译完成后按次数从主账号里扣费
入参列表:
参数名称 | 参数说明 | 参数类型 | 备注 | 是否必填 |
---|---|---|---|---|
appid | 应用的唯一识别标记 | String | 是 | |
token | 签名 | String | 见token生成规则 | 是 |
nonce_str | 随机字符串 | String | 是 | |
from | 源语言 | String | 见图片语言列表 | 是 |
md5 | 源文件md5 | String | md5小写 | 是 |
出参列表:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
code | 状态码 | int | 详见状态码列表 |
msg | 返回状态说明 | String | |
data | 返回数据结果集 | String | Json字符串 |
data结果集:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
words_result_num | 识别文字行数 | Int | |
words_result | 识别文字 | Array[] | |
words | 识别文字内容 | String | |
location | 文字位置 | Object | |
top | 顶部 | Int | |
left | 左 | Int | |
width | 宽 | Int | |
height | 高 | Int |
返回结果:
{"msg":"请求成功","code":100,"data":{"words_result":[{"words":"X Headers","location":{"top":0,"left":47,"width":96," height":10}}],"words_result_num":9}}
词典搜索
接口名称:dict/search
接口完整路径:https://www.fanyigou.com/TranslateApi/api/dict/search
入参列表:
参数名称 | 参数说明 | 参数类型 | 备注 | 是否必填 |
---|---|---|---|---|
appid | 应用的唯一识别标记 | String | 是 | |
token | 签名 | String | 见token生成规则 | 是 |
nonce_str | 随机字符串 | String | 是 | |
word | 搜索词 | String | 词语,小于等于15个字符 | 是 |
出参列表:
参数名称 | 参数说明 | 参数类型 | 备注 |
---|---|---|---|
code | 状态码 | int | 详见状态码列表 |
msg | 返回状态说明 | String | |
data | 返回数据结果集 | String | Json字符串 |
data结果集:

返回结果:
{"msg":"请求成功","code":100,"data":{"dict":{"base":{"explain":{"word_means":[{"part":"n.","means":["入口,通道","(使用或见到的)机会/权利"]},{"part":"v.","means":["访问,存取(计算机信息)","到达,进入,使用"]}],"case_word":["ACCESS"]},"explain_zh":"","exchange":{"word_ing":["accessing"],"word_done":["accessed"],"word_past":["accessed"],"word_third":["accesses"],"word_pl":[]},"pron_zh":"","pron_am":{"text":"ˈækses","pronounce":""},"pron_en":{"text":"ˈækses","pronounce":""},"word":"access","chinese":false},"practical_sentences":[],"true_sentences":[{"tag":"四级","sentences":[]},{"tag":"六级","sentences":[]},{"tag":"高考","sentences":[{"text":"Depending on which role you choose, you could help to increase a community's access to safe drinking water, or help to protect valuable local cultures.","text_cn":"","source":"2019年高考英语北京卷 阅读理解 阅读A 原文"},{"text":"Designers have also created informal gathering places, and upgraded employees' access to heavily trafficked areas such as copy and coffee rooms.","text_cn":"","source":"2015年高考英语上海卷 选词填空 原文"},{"text":"Instead, computer users are developing stronger transactive memories; that is, people are learning how to organize huge quantities of information so that they are able to access it at a later date.","text_cn":"","source":"2015年高考英语安徽卷 阅读理解 阅读C 原文"},{"text":"It was really annoying; I couldn't get access to the data bank you had recommended.","text_cn":"","source":"2016年高考英语天津卷 单项填空 原文"},{"text":"One crucial factor is secure access to land.","text_cn":"","source":"2018年高考英语江苏卷 阅读理解 阅读C 原文"},{"text":"People have better access to health care than they used to, and they're living longer as a result.","text_cn":"","source":"2017年高考英语北京卷 单项填空 原文"},{"text":"Some also contain cd-roms and access to special online features.","text_cn":"","source":"2015年高考英语湖南卷 任务型读写 原文"},{"text":"Thus I have been allowed to gain access to their living environment.","text_cn":"","source":"2016年高考英语四川卷 阅读理解 阅读C 原文"},{"text":"Thus, the keyboard can determine people's identities, and by extension, whether they should be given access to the computer it's connected to—regardless of whether someone gets the password right.","text_cn":"","source":"2019年高考英语全国卷I 阅读理解 阅读C 原文"},{"text":"We need a better way to access information.","text_cn":"","source":"2015年高考英语安徽卷 阅读理解 阅读C 选项"}]},{"tag":"考研","sentences":[{"text":"Not only did they develop such a device but by the turn of the millennium they had also managed to embed it in a worldwide system accessed by billions of people every day.","text_cn":"","source":"出自-2012年考研阅读原文"},{"text":"When we don't understand the value of mental health and we don't know how to gain access to it, mental health will remain hidden from us.","text_cn":"","source":"出自-2016年考研翻译原文"},{"text":"The charter’s main tool of enforcement is to deny access for designers and modeling agencies to Copenhagen Fashion Week ( ' , CFW), which is run by the Danish Fashion Institute.","text_cn":"","source":"出自-2016年考研阅读原文"},{"text":"Rather officials must avoid double standards, or different types of access for average people and the wealthy.","text_cn":"","source":"出自-2017年考研阅读原文"},{"text":"Merely helping a gift-giver gain access to other officials, unless done with clear intent to pressure those officials, is not corruption, the justices found.","text_cn":"","source":"出自-2017年考研阅读原文"},{"text":"Favoritism in official access can fan public perceptions of corruption.","text_cn":"","source":"出自-2017年考研阅读原文"},{"text":"But the ruling reinforces the need for citizens and their elected representatives, not the courts, to ensure equality of access to government.","text_cn":"","source":"出自-2017年考研阅读原文"},{"text":"But it did so while holding its nose at the ethics of his conduct, which included accepting gifts such as a Rolex watch and a Ferrari automobile from a company seeking access to government.","text_cn":"","source":"出自-2017年考研阅读原文"},{"text":"But it did so while holding its nose at the ethics of his conduct, which included accepting gifts such as a Rolex watch and a Ferrari Automobile from a company seeking access to government.","text_cn":"","source":"2017年考研真题(英语一)阅读理解 Section Ⅱ"},{"text":"Critics make three main arguments against gene patents: a gene is a product of nature, so it may not be patented; gene patents suppress innovation rather than reward it; and patents'monopolies restrict access to genetic tests such as Myriad's.","text_cn":"","source":"2012年考研真题(英语二)阅读理解 Section Ⅱ"},{"text":"In Britain the move towards open access publishing has been driven by funding bodies.","text_cn":"","source":"2020年考研真题(英语一)阅读理解 Section Ⅱ"},{"text":"It can't when so many more employers have so much more access to so much more above average cheap foreign labor, cheap robotics, cheap software, cheap automation and cheap genius.","text_cn":"","source":"2013年考研真题(英语二)阅读理解 Section Ⅱ"},{"text":"Merely helping a gift-giver gain access to other officials, unless done with clear intent to pressure those officials, is not corruption, the Justices found.","text_cn":"","source":"2017年考研真题(英语一)阅读理解 Section Ⅱ"},{"text":"More than half of all British scientific research is now published under open access terms: either freely available from the moment of publication, or paywalled for a year or more so that the publishers can make a profit before being placed on general rel","text_cn":"","source":"2020年考研真题(英语一)阅读理解 Section Ⅱ"},{"text":"The charter's main tool of enforcement is to deny access for designers and modeling agencies to Copenhagen Fashion Week, which is run by the Danish Fashion Institute.","text_cn":"","source":"2016年考研真题(英语一)阅读理解 Section Ⅱ"},{"text":"The Dutch giant Elsevier, which claims to publish 25% of the scientific papers produced in the world, made profits of more than £900m last year, while UK universities alone spent more than £210m in 2016 to enable researchers to access their own publicly f","text_cn":"","source":"2020年考研真题(英语一)阅读理解 Section Ⅱ"},{"text":"The fact that this is not an uncommon occurrence means that dishonest persons might be able to access bank accounts in electronic payments systems and steal from someone else's accounts.","text_cn":"","source":"2013年考研真题(英语二)完形填空 Section Ⅰ"},{"text":"The most drastic, and thoroughly illegal, reaction has been the emergence of Sci-Hub, a kind of global photocopier for scientific papers, set up in 2012, which now claims to offer access to every paywalled article published since 2015.","text_cn":"","source":"2020年考研真题(英语一)阅读理解 Section Ⅱ"},{"text":"There are concerns that government, employers, and marketers might be able to access these data, thereby violating our privacy.","text_cn":"","source":"2013年考研真题(英语二)完形填空 Section Ⅰ"},{"text":"We often hear media reports that an unauthorized hacker has been able to access a computer database and to alter information stored there.","text_cn":"","source":"2013年考研真题(英语二)完形填空 Section Ⅰ"}]}],"ee_means":[],"roots_affixes":[],"phrases":[],"synonym":[{"part":"n.","word_means":[{"mean":"接近的机会","words":["of","way","entry","approach"]}]},{"part":"","word_means":[{"mean":"其他释义","words":["advent","retirement","admission","course","license","retreat","passport","accession","approach","door"]}]}],"antonym":[{"part":"n.","word_means":[{"mean":"接近;进入","words":["retirement","retreat"]}]}],"industry_dict":[],"synonym_explain":[],"collins":[{"entries":[{"define":"If you have access to a building or other place, you are able or allowed to go into it.","trans":"进入(权);通道;入径","part":"N-UNCOUNT","sentences":[{"origin":"The facilities have been adapted to give access to wheelchair users.","trans":"这些设施已经改造过以方便轮椅使用者进入。"},{"origin":"Scientists have only recently been able to gain access to the area...","trans":"科学家直到最近才得以进入该地区。"}]},{"define":"If you have access to something such as information or equipment, you have the opportunity or right to see it or use it.","trans":"查阅(或使用)的机会(或权利)","part":"N-UNCOUNT","sentences":[{"origin":"...a Code of Practice that would give patients right of access to their medical records.","trans":"允许病人查看自己病历的职业准则"},{"origin":"...whether one has access to a dish and the other accoutrements needed to watch satellite TV.","trans":"是否能使用碟型卫星天线以及其他观看卫星电视所需要的装备"}]},{"define":"If you have access to a person, you have the opportunity or right to see them or meet them.","trans":"接近(或面见)的机会(或权利)","part":"N-UNCOUNT","sentences":[{"origin":"He was not allowed access to a lawyer.","trans":"他未被获准见律师。"},{"origin":"My ex-wife deliberately sabotages my access to the children.","trans":"我的前妻蓄意阻挠我见孩子。"}]},{"define":"If you access something, especially information held on a computer, you succeed in finding or obtaining it.","trans":"存取,访问(计算机信息)","part":"VERB","sentences":[{"origin":"You've illegally accessed and misused confidential security files.","trans":"你已经非法访问并盗用了机密的安全文件。"}]}]}]}}}
安全规范
1、签名算法
签名生成的通用步骤如下:
第一步,设所有发送或者接收到的数据为集合M(包括平台生成的privatekey),将集合M内非空参数值的参数按照参数名ASCII码从小到大排序(字典序),使用URL键值对的格式(即key1=value1&key2=value2…)拼接成字符串stringA。
特别注意以下重要规则:
◆ 参数名ASCII码从小到大排序(字典序);
◆ 如果参数的值为空不参与签名;
◆ 参数名区分大小写;
◆ 验证调用返回或主动通知签名时,传送的token参数不参与签名,将生成的签名与该token值作校验。
◆ 接口可能增加字段,验证签名时必须支持增加的扩展字段
第二步,对stringA进行MD5运算,再将得到的字符串所有字符转换为大写,得到token值。
◆ privatekey设置路径:翻译狗开发平台-->控制台-->开发者信息-->申请信息
举例:
假设传送的参数如下:
appid:1522125815142 nonce_str:ibuaiVcKdpRxkhJA from : en to : zh md5 : 5b21f2eeda4726c74274fc27a53bac74 第一步:对参数按照key=value的格式(包括privatekey),并按照参数名ASCII字典序排序如下: stringA="appid=1522125815142&from=en&md5=5b21f2eeda4726c74274fc27a53bac74&nonce_str=ibuaiVcKdpRxkhJA&privatekey=4892ef64ewf5sffdf&to=zh"; 第二步:加密: token=MD5(stringA).toUpperCase()="31956D481EFF09D7F3EB7C1312BC61E0" 最终得到最终发送的数据: appid:1522125815142 nonce_str:ibuaiVcKdpRxkhJA from : en to : zh md5 : 5b21f2eeda4726c74274fc27a53bac74 token : 31956D481EFF09D7F3EB7C1312BC61E0
2、生成随机数算法
API接口协议中包含字段nonce_str,主要保证签名不可预测。我们推荐生成随机数算法如下:调用随机数函数生成,将得到的值转换为字符串。
协议规则
用户接入API时,调用API必须遵循以下规则:提交方式 | 采用POST方法提交 |
---|---|
字符编码 | 统一采用UTF-8字符编码 |
签名算法 | MD5,后续会兼容SHA1、SHA256等。 |
签名要求 | 请求需要校验签名,详细方法请参考安全规范-签名算法 | 判断逻辑 | 先判断协议字段返回,再判断业务返回 |
语言列表
语言代码 | 语言 |
---|---|
"" 或 auto | 自动检测 |
zh | 中文 |
jp | 日语 |
th | 泰语 |
fra | 法语 |
en | 英语 |
spa | 西班牙语 |
kor | 韩语 |
tr | 土耳其语 |
vie | 越南语 |
ms | 马来语 |
de | 德语 |
ru | 俄语 |
ara | 阿拉伯语 |
est | 爱沙尼亚语 |
be | 白俄罗斯语 |
bul | 保加利亚语 |
hi | 印地语 |
is | 冰岛语 |
tl | 菲律宾语 |
fin | 芬兰语 |
nl | 荷兰语 |
ca | 加泰罗尼亚语 |
cs | 捷克语 |
hr | 克罗地亚语 |
lv | 拉脱维亚语 |
lt | 立陶宛语 |
rom | 罗马尼亚语 |
no | 挪威语 |
pt | 葡萄牙语 |
swe | 瑞典语 |
sr | 塞尔维亚语 |
eo | 世界语 |
sk | 斯洛伐克语 |
slo | 斯洛文尼亚语 |
sw | 斯瓦希里语 |
uk | 乌克兰语 |
iw | 希伯来语 |
el | 希腊语 |
hu | 匈牙利语 |
hy | 亚美尼亚语 |
it | 意大利语 |
id | 印尼语 |
sq | 阿尔巴尼亚语 |
am | 阿姆哈拉语 |
az | 阿塞拜疆语 |
eu | 巴斯克语 |
bn | 孟加拉语 |
bs | 波斯尼亚语 |
gl | 加利西亚语 |
ka | 格鲁吉亚语 |
gu | 古吉拉特语 |
ig | 伊博语 |
ga | 爱尔兰语 |
zu | 祖鲁语 |
kn | 卡纳达语 |
kk | 哈萨克语 |
ky | 吉尔吉斯语 |
lb | 卢森堡语 |
mk | 马其顿语 |
mt | 马耳他语 |
mi | 毛利语 |
mr | 马拉提语 |
ne | 尼泊尔语 |
pa | 旁遮普语 |
si | 僧加罗语 |
ta | 泰米尔语 |
te | 泰卢固语 |
ur | 乌尔都语 |
uz | 乌兹别克语 |
cy | 威尔士语 |
yo | 约鲁巴语 |
cht | 中文繁体 |
状态码列表
系统状态码:状态码 | 状态描述 |
---|---|
100 | 请求成功 |
101 | 没有访问权限 |
102 | 业务停机 |
103 | 账户不存在 |
104 | 账户异常 |
105 | 系统错误 |
106 | 参数异常 |
107 | 黑名单管控 |
108 | 访问地址频率过高 |
109 | 该应用不存在 |
110 | 该应用尚未启用 |
111 | 无该功能权限 |
状态码 | 状态描述 |
---|---|
300 | 参数为空 |
301 | 文件为空 |
302 | 文件类型不支持 |
303 | 文件MD5不匹配 |
304 | 可用积分不足 |
305 | 文档已加密或被保护 |
306 | 文档不能识别 |
307 | 文档损坏 |
309 | 文档无法成功读取或读取超时,请将文件转换成其他版本的word或pdf后再次尝试 |
310 | 自动处理超时,等待人工处理 |
311 | 文件大小超过限制(50M) |
312 | 该翻译不存在 |
313 | 进行中 |
314 | 翻译完成 |
315 | 正在传递 |
316 | 处理超时 |
317 | 已取消 |
318 | 该文件不存在 |
320 | 翻译通道已被占用(不能上传进行翻译,需等待正在翻译的文件翻译结束) |
321 | 没有读取到需要翻译的内容 |
322 | 图片文件大小超过限制(20M) |
323 | 图片文件像素超过限制(1000万) |
324 | 图片文件解析失败 |
325 | 正在人工处理 |
326 | 重复翻译 |
327 | 文档页数超限 |
328 | 图片生成失败 |
329 | 该文档状态异常 |
330 | 检测页数完成 |
行业列表
行业代码 | 行业 |
---|---|
1 | 法律 |
2 | 金融 |
3 | 农林牧渔 |
4 | 医药卫生 |
5 | 建筑建材 |
6 | 冶金矿产 |
7 | 石油化工 |
8 | 水利水电 |
9 | 交通运输 |
10 | 信息产业 |
11 | 机械机电 |
12 | 轻工食品 |
13 | 服装纺织 |
14 | 专业服务 |
15 | 安全防护 |
16 | 环保绿化 |
17 | 旅游休闲 |
18 | 办公文教 |
19 | 电子电工 |
20 | 玩具礼品 |
21 | 家居用品 |
22 | 物资 |
23 | 包装 |
24 | 体育 |
25 | 办公 |
26 | 其他 |
JAVA-SDK调用说明
运行环境:JDK8
在项目的pom.xml的dependencies中加入以下内容:
<dependency>
<groupId>com.qingxun</groupId>
<artifactId>java-sdk-api</artifactId>
<version>0.0.1</version>
<dependency>
private static String appId = "您的应用id"; private static String privateKey = "您的密钥"; private static OpenApiClient defaultOpenApiClient = new DefaultOpenApiClient(appId, privateKey); private static String filePath = "您需要上传的文件路径"; private static String fromLanguage = "文件的源语言"; private static String toLanguage = "文件的目标语言"; public static void main(String[] args) { //包装了上传文件的参数 UploadTransRequest uploadTransRequest = new UploadTransRequest.Builder().setFrom(fromLanguage) .setTo(toLanguage).setFile(new File(filePath)) .builder(); //包装了上传文件的响应参数 {"code": 100,"data": {"tid": 14587},"msg": "请求成功"} UploadTransResponse uploadTransResponse = defaultOpenApiClient.excute(uploadTransRequest); //对应响应数据的code log.info("code:{}",uploadTransResponse.getApiCode()); //对应响应数据的msg log.info("msg:{}",uploadTransResponse.getApiMsg()); //其他字段,tid对应data中的tid log.info("tid:{}", uploadTransResponse.getTid()); }
PHP-SDK调用说明
PHP 7.1+
cURL extension
使用Composer来管理项目依赖项,请在项目的根目录中运行以下命令:
composer require fanyigou/api-sdk-php
在Composer依赖管理器安装完成后,在您的PHP代码中导入该依赖项:
require_once __DIR__ . '/vendor/autoload.php'
<?php include_once __DIR__.'/vendor/autoload.php'; use Fanyigou\ApiSdkPhp\Dispatch; use Fanyigou\ApiSdkPhp\DispatchException; $appKey = '您的应用ID'; $secKey = '您的密钥'; $dispatch = new Dispatch(['app_key' => $appKey, 'sec_key' => $secKey]); $filePath = '文档路径'; //文档路径 $params = [ 'from' => 'en', 'to' => 'zh', ]; try { $result = $dispatch->uploadTranslate($params, $filePath); print_r($result); } catch (DispatchException $e) { print_r($e->getMessage()); }
PYTHON-SDK调用说明
1.运行环境 python3.x
2.调用前需安装第三方环境
pip install requests-toolbelt pip install requests
pip install qingxun-openapi-python-sdk
from qingxunsdk.TranslateApi import qxkjApi
#引用api库 from qingxunsdk.TranslateApi import qxkjApi from_ = "源语言" to = "目标语言" filepath = "本机上需要上传翻译的文件地址" filename = "文件名" ip = "ip" appid = "设备码" privatekey = "密钥" #初始化api qxkjapi = qxkjApi.qxkj_api(ip,appid,privatekey) #调用需要的方法(当前按方法是上传并翻译接口) res = qxkjapi.uploadTranslate(from_,to,filepath,filename) #文档上传有四个追加参数 # industryId 行业代码 int 见行业列表 否 # transImg 文档内图片翻译 int 0:不翻译文档内图片(默认),1:翻译文档内图片。目前支持中、英、日、韩的文档内图片翻译。(如有需要请联系销售开通) 否 # excelMode 指定excel翻译模式 int 0:只翻译当前打开sheet(默认),1:翻译全部sheet(页数按全部sheet字符数来计算) 否 # bilingualControl 指定翻译模式 int 0:译文单独为一个文档(默认),1:双语对照(原文和译文在一个文档) 否 # 可以在参数后边用(industryId = 0 ,transImg=0 , excelMode = 0,bilingualControl=0)进行追加 # 追加示例(详情参数请查看开放平台) res = qxkjapi.uploadTranslate(from_,to,filepath,filename,industryId = 0 ,transImg=0 , excelMode = 0,bilingualControl=0) #打印结果 print(res) # 返回示例 # {'msg': '请求成功', 'code': 100, 'data': {'tid': tid}} # 查询进度接口 # res = qxkjapi.queryTransProgress("tid") # 文档下载接口 # res = qxkjapi.downloadFile("tid","3") # 参数详情请查看开放平台文档 "http://open.qingxun.com/filecore.html"

扫一扫群二维码,立刻加入该群
群号:21120026830