transdraft
Contact information
Address

114 Bailey Rd.
Lanesboro MA - United States

Email

info@transdraft.com

Skype

diasks2

API

Easily create your translation jobs through our free API

Why use our API?

It is very easy to use our web form to create a new translation job for your translator; however, you may have a use case where it would be easier to programmatically send your translation jobs to transdraft. In that case, it is best to use our free API to create a new translation job.

Simple, yet powerful

The transdraft API is very easy to use. Let's walk through an example. In our example we will submit an English text to transdraft user roboTransdraft to be translated into Japanese. To create a new translation with the transdraft API you need to specify the following parameters:

1) your name

This is your name. It is provided to the translator so that she knows who the translation is for.
Example:

translation[client_name]=Kevin

If you do not provide the client name you will receive the following error message:

{"errors":{"client_name":["can't be blank"]}}
2) your email

This is your email. It is provided so that we can email you when your translation is ready.
Example:

translation[client_email]=kevin@example.com

If you do not provide the client email you will receive the following error message:

{"errors":{"client_email":["can't be blank"]}}
3) translator username

This is the transdraft username of the translator who will be translating your text.
Example:

translation[translator_username]=roboTransdraft

If the username doesn't exist you will receive the following error message:

{"error":"A transdraft user with that username could not be found."}
4) source language

This specifies the language that your text is in. You should specify the source language using one of the ISO 639-1 codes (see our table below to find the correct code).
Example:

translation[source_language]=en

If the source language code can not be found you will receive the following error message:

{"error":"The source language you supplied does not match any ISO 639-1 codes in our database. Please double check your ISO 639-1 language code and try again."}
5) target language

This specifies the language you would like your text translated into. You should specify the target language using one of the ISO 639-1 codes (see our table below to find the correct code).
Example:

translation[target_language]=ja

If the target language code can not be found you will receive the following error message:

{"error":"The target language you supplied does not match any ISO 639-1 codes in our database. Please double check your ISO 639-1 language code and try again."}
6) translation description

For the best translation possible, fill in the details regarding purpose, target, tone, or any other information that might be relevant.
Example:

translation[description]=This translation is for our email newsletter. It should be friendly but not too informal.

If you do not provide a description you will receive the following error message:

{"errors":{"description":["can't be blank"]}}
7) translation text

This is the text that you want your translator to translate.
Example:

translation[content]=Welcome to the transdraft API. Hello World! Do you like it?

If you do not provide the text to be translated you will receive the following error message:

{"errors":{"text":["can't be blank"]}}

To ensure that your text is properly received we HIGHLY recommend encoding it first. This will help ensure to preserve new lines and any special characters that might be in your text.

The following code example is one way to encode text if you are using JavaScript:

function encode(string) { return encodeURIComponent(string).replace(/'/g,"%27").replace(/"/g,"%22"); }

NB - cURL also features the command line option --data-urlencode

The are above text would become encoded as follows:

translation[content]=Welcome%20to%20the%20transdraft%20API.%20Hello%20World!%20Do%20you%20like%20it%3F
8) Password

This is password so that only you can access the URL of your translation. It will be required to view your final translation.
Example:

translation[password]=Te$TPassword12345

If you do not provide a password you will receive the following error message:

{"errors":{"password":["can't be blank"]}}
9) Password Confirmation

This a confirmation of your password.
Example:

translation[password_confirmation]=Te$TPassword12345

If you do not provide a password confirmation you will receive the following error message:

{"errors":{"password_confirmation":["can't be blank"]}}

Bringing it all together

Let's try a real live example. You will create a new translation job for our transdraft test account. Paste the following line in your terminal window:

$ curl -d 'translation[client_name]=Kevin&translation[client_email]=kevin@example.com&translation[translator_username]=roboTransdraft&translation[source_language]=en&translation[target_language]=ja&translation[description]=This%20translation%20is%20for%20our%20email%20newsletter.%20It%20should%20be%20friendly%20but%20not%20too%20informal.&translation[content]=Welcome%20to%20the%20transdraft%20API.%20Hello%20World!%20Do%20you%20like%20it%3F&translation[password]=Te$TPassword12345&translation[password_confirmation]=Te$TPassword12345' https://www.transdraft.com/api/v1/translations

If all went well you should receive the following response (except your token will be different):

{"client_name":"Kevin","client_email":"kevin@example.com","translator_username":"roboTransdraft","source_language":"en","target_language":"ja","description":"This translation is for our email newsletter. It should be friendly but not too informal.","text":"Welcome to the transdraft API. Hello World! Do you like it?","token":"97wQx1IZ","status":"submitted","link":"https://www.transdraft.com/translations/97wQx1IZ"}
ISO 639-1 Language Codes
ISO 639-1 Code Language Name
aaAfar
abAbkhazian
afAfrikaans
amAmharic
arArabic
asAssamese
ayAymara
azAzerbaijani
baBashkir
beByelorussian
bgBulgarian
bhBihari
biBislama
bnBengali
boTibetan
brBreton
caCatalan
coCorsican
csCzech
cyWelsh
daDanish
deGerman
dzBhutani
elGreek
enEnglish
eoEsperanto
esSpanish
etEstonian
euBasque
faPersian
fiFinnish
fjFiji
foFaeroese
frFrench
fyFrisian
gaIrish
gdScots Gaelic
glGalician
gnGuarani
guGujarati
haHausa
hiHindi
heHebrew
hrCroatian
huHungarian
hyArmenian
iaInterlingua
idIndonesian
ieInterlingue
ikInupiak
isIcelandic
itItalian
iuInuktitut (Eskimo)
jaJapanese
jwJavanese
kaGeorgian
kkKazakh
klGreenlandic
kmCambodian
knKannada
koKorean
ksKashmiri
kuKurdish
kyKirghiz
laLatin
lnLingala
loLaothian
ltLithuanian
lvLatvian, Lettish
mgMalagasy
miMaori
mkMacedonian
mlMalayalam
mnMongolian
moMoldavian
mrMarathi
msMalay
mtMaltese
myBurmese
naNauru
neNepali
nlDutch
noNorwegian
ocOccitan
om(Afan) Oromo
orOriya
paPunjabi
plPolish
psPashto, Pushto
ptPortuguese
quQuechua
rmRhaeto-Romance
rnKirundi
roRomanian
ruRussian
rwKinyarwanda
saSanskrit
sdSindhi
sgSangro
shSerbo-Croatian
siSinghalese
skSlovak
slSlovenian
smSamoan
snShona
soSomali
sqAlbanian
srSerbian
ssSiswati
stSesotho
suSudanese
svSwedish
swSwahili
taTamil
teTegulu
tgTajik
thThai
tiTigrinya
tkTurkmen
tlTagalog
tnSetswana
toTonga
trTurkish
tsTsonga
ttTatar
twTwi
ugUigur
ukUkrainian
urUrdu
uzUzbek
viVietnamese
voVolapuk
woWolof
xhXhosa
yiYiddish
yoYoruba
zaZhuang
zhChinese
zuZulu