登录
免费注册
提示:当前为新版开放平台,仅支持页数计费相关显示。旧版付费模式(积分模式),请切换旧版(http://open.fanyigou.com)使用,感谢您的理解!

上传

接口名称: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源文件md5Stringmd5小写
industryId行业代码int见行业列表
transImg文档内图片翻译int0:不翻译文档内图片(默认),1:翻译文档内图片。目前支持中、英、日、韩的文档内图片翻译。(如有需要请联系销售开通)
excelMode指定excel翻译模式int0:只翻译当前打开sheet(默认),1:翻译全部sheet(页数按全部sheet字符数来计算)
bilingualControl指定翻译模式int0:译文单独为一个文档(默认),1:双语对照(原文和译文在一个文档)

出参列表:

参数名称参数说明参数类型备注
code状态码int详见状态码列表
msg返回状态说明String
data返回数据结果集StringJson字符串

data结果集:

参数名称参数说明参数类型备注
tid翻译idString通过该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查询状态结果Idint上传源文件后可获取该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返回数据结果集StringJson字符串

data结果集:

参数名称参数说明参数类型备注
tid查询翻译idint通过该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源文件md5Stringmd5小写

出参列表:

参数名称参数说明参数类型备注
code状态码int详见状态码列表
msg返回状态说明String
data返回数据结果集StringJson字符串

data结果集:

参数名称参数说明参数类型备注
tid翻译idint通过该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检测文档页数接口返回的tidint
from源语言String见语言列表
to目标语言(不支持自动检测)String见语言列表
industryId行业代码int见行业列表
transImg文档内图片翻译int0:不翻译文档内图片(默认),1:翻译文档内图片。目前支持中、英、日、韩的文档内图片翻译。(如有需要请联系销售开通)
excelMode指定excel翻译模式int0:只翻译当前打开sheet(默认),1:翻译全部sheet(页数按全部sheet字符数来计算)
bilingualControl指定翻译模式int0:译文单独为一个文档(默认),1:双语对照(原文和译文在一个文档)

出参列表:

参数名称参数说明参数类型备注
code状态码int详见状态码列表
msg返回状态说明String
data返回数据结果集StringJson字符串

返回结果:

{"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源文件md5String

出参列表:

参数名称参数说明参数类型备注
code状态码int详见状态码列表
msg返回状态说明String
data返回数据结果集StringJson字符串

data结果集:

参数名称参数说明参数类型备注
tid任务idString通过该id可查询进度等

返回结果:

{"code": 100,"data": {"tid": 14587},"msg": "请求成功"}

回调通知

回调说明:翻译任务、转换任务,失败或成功时会发起回调

请求方式:post, application/json

目前回调地址需要后台设置,后续会开放设置

回调接口处理完成后须返回“success”字符串

回调参数列表:

参数名称参数说明参数类型备注
tid查询任务idint通过该id可查询任务进度等
title文件名String
docType文件类型String
fromLan源语言String
toLan目标语言String
detectLan检测的语言String不为空即为自动检测出的主要语言,仅供参考
percent任务进度String
pageCount文件页数int
status任务状态int详见文件任务状态码
msg状态说明String
createTime创建时间String
updateTime更新时间String
type任务类型int1:文档翻译(默认),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返回数据结果集StringJson字符串

data结果集:

参数名称参数说明参数类型备注
deductType0:按积分计费,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返回数据结果集StringJson字符串

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源文件md5Stringmd5小写

出参列表:

参数名称参数说明参数类型备注
code状态码int详见状态码列表
msg返回状态说明String
data返回数据结果集StringJson字符串

data结果集:

参数名称参数说明参数类型备注
taskId翻译idString通过该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查询状态结果Idint

出参列表:

参数名称参数说明参数类型备注
code状态码int详见状态码列表
msg返回状态说明String
data返回数据结果集StringJson字符串

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查询状态结果Idint上传源文件后可获取该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源文件md5Stringmd5小写

出参列表:

参数名称参数说明参数类型备注
code状态码int详见状态码列表
msg返回状态说明String
data返回数据结果集StringJson字符串

data结果集:

参数名称参数说明参数类型备注
words_result_num识别文字行数Int
words_result识别文字Array[]
words识别文字内容String
location文字位置Object
top顶部Int
leftInt
widthInt
heightInt

返回结果:

{"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返回数据结果集StringJson字符串

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
操作步骤
1.安装
pip install qingxun-openapi-python-sdk
2.引用
from qingxunsdk.TranslateApi import qxkjApi
3.调用方式(参考下方示例代码)
示例代码
    #引用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"
                                    
购买的企业版有效期到期,到期后如何延长文件储存时长?
到期后数据我们会自动免费为您保存10日(到期时间顺延10日),若您有复购需求,10日内完成复购即可延长文件在线存储时长;若您无复购需求,建议您尽早下载文件保存到本地,避免文件丢失。
企业版有页数,为何翻译需要收费?
请登录翻译狗企业版(网址:https://enterprise.fanyigou.com/),再次尝试。
文件翻译后出现乱码?
翻译文件乱码问题出现原因主要为原文件加密,上传翻译时未对文件解密,请解密文件后重试。
翻译狗企业版与个人版有何区别?
翻译狗企业版提供项目管理功能,可创建多个子账号共同使用,同时提供机器辅助翻译CAT功能,用户可在线校对译文,提高翻译准确性。
翻译狗企业套餐有效期如何计算?套餐内页数有效期如何计算?
购买的企业版套餐有效期,以不同套餐开通的具体日期为开始时间,在套餐有效期内,套餐内页数均可使用,直至套餐到期;若套餐到期后您有未使用完的页数,将会自动清零,请根据需要尽早使用套餐内页数。
我是海外用户,我想使用企业版,应该如何登录?
海外用户可以使用邮箱进行账号注册登录。
如何更换企业账号管理员?
提交工单,工作日时间24小时内立即受理。
企业版子账号收不到短信验证码相关,无法登录该如何处理?
您的账号可能注册了翻译狗个人版账号,现提供给您2种登录方式:①使用您翻译狗个人版账号密码登录翻译狗企业版,系统会自动为您跳转页面;②登录时选择输入手机号/邮箱登录方式,点击忘记密码,完成验证登录。
使用企业版翻译完成后,文件为空白页面怎么办?
请拨打4001-868-556 或 提交工单 联系客服,客服将为您优先处理。
企业套餐页数怎么分配使用?
您购买的企业套餐页数,可以登录企业主账号,根据需要手动分配给子账号用户使用。
文字翻译空格是否算字符?
文字翻译空格也会被计算为字符。
接口调用支持哪些方式?是否提供demo案例?
接口调用支持标准HTTP请求调用,也可以基于SDK调用,目前提供的SDK有JAVA、PHP和PYTHON。请参考文档中心-SDK调用示例
翻译文档出错怎么办?
请拨打4001-868-556 或 提交工单 联系客服,客服将为您优先处理。
翻译狗本地部署服务是否支持离线部署?
翻译狗本地部署服务支持离线部署,目前翻译狗在线的语言共120+种,全部支持离线部署。
翻译狗本地部署服务采用离线部署方式,如何进行收费?
请拨打电话15381069892联系翻译狗商务获取报价信息。
系统需要维护升级及时间相关。
请拨打电话15381069892联系翻译狗团队。
翻译狗开放平台技术交流群 项目

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

群号:21120026830

客服
帮助
工单