Translate Your Software
 
Login / Project    Join for FREE
a product of a product of Translate Your World
 
 

 

API

 

While working on integration, use the demo area (below listed as “demo2”). When go into production, replace “demo2” with “www”.

Call the TYW system using the exact same URL every time. The below clientkey (your password) will be sent in separate document and/or email.

To send xml method :
http://demo2.translateyourworld.eu/apis/demo2.translateyourworld.eu/apis/restxml/clientkey

To send html method : http://demo2.translateyourworld.eu/apis/demo2.translateyourworld.eu/apis/resthtml/clientkey

Other parameters will be specified in POST variables: client id, client name (e.g. RockTenn), project id, language desired. When initiating contact with TYW, use “i” variables (variables that start with the letter “i” for “input”). All variable content can be small, caps, or mixed. TYW is agnostic. For variable names themselves, those with cap & small letters affect the selection of data. Variables with all small letters are general content that will vary with whatever you wish to exchange with TYW.

* indicates required variable content.

*i_ClientID Currently expects a TYW client ID
*i_ClientName Generally a company name, as may be displayed on screen
*i_ProjectID Currently expects a TYW project ID
*i_ProjectName Can be TYW name or from third party with cross-reference
*i_SelfTitle Name of the software in TYW you want to use, e.g. TranslateYourWebPage, SubtitleYourVideo, TranslateYourTraining...)
*i_LanguageField Language of the data you are sending. @IS has a clean list of 200 languages and dialects. “English” is not sufficient, there are 14 dialects of English
*i_MasterLanguage The language in which the project was originally created — therefore could possibly be that was translated from the i_MasterLanguage into i_LanguageField. Sometimes, i_MasterLanguage and i_LanguageField are identical, such as subtitling an English video to show English subtitles, possibly for the deaf or for hard-to-understand accented speakers. TYW provides a full language selection and is suggested that you borrow. TYW also offers customized languages that are used for versioning when there are personalizations of content by region, company or person.
i_input1, i_input2, i_input3,i_input4,i_input5 A series of variables to hold blob or xml data. Which of these is required will vary with the function called
*i_input6 For API calls, should always be “FromAPI”
*i_FunctionCalled The function you require, has a specific meaning, discussed below
i_ScriptField This is the main data exchange variable. can contain any blob, list or XML data you desire to send. This data will be processed as text. So, even if is XML, code, or blob, will be treated as one gigantic text string. Example of i_Scriptfield content might be a huge list of your clients cross-checking with TYW as to which ones have signed up and used TYW and for how much revenue.

TYW RETURNS

When TYW exports data to your system, the data will be sent in “o” variables (variables that start with the letter “o” for “output”)

* indicates assured return content

*o_ClientID Reflection of what was passed thru API
*o_ClientName Reflection of what was passed thru API
*o_ProjectID Reflection of what was passed thru API
*o_ProjectName Reflection of what was passed thru API
*o_SelfTitle Name of the software in TYW from which the data is gathered, e.g. TranslateYourWebPage, SubtitleYourVideo,TranslateYourTraining... probabl same as sent during call
*o_LanguageField Language of the data being received
o_output1, o_output2 TYW assigned content. If you sent data in i_ScriptField, the result would be expected to be in o_output1. If 2 results are expected (one in the master language and one in a foreign language) the master language will be in o_output1 and the translation language content would be in o_output2. API’s generally do not call many functions. Handle each separately.
o_output6 “FromAPI” may have disappeared – or become different data. Do not use.

Note:

o_Output1 will generally contain the data you requested as XML.

TYW does not use http status codes for anything special; check the returned XML for error messages to see if anything went wrong. TYW system will return an http status code of 200 practically all of the time.

 

VARIABLE: i_FunctionCalled

TYW will perform a broad variety of functions on demand, including data dumps, organized data exports and retrieval, actions performed, and SQL calls and statements. The code that is run will vary with the content of the post variable “i_FunctionCalled”. For example, if you desire a list of available subtitled movies for a client, then i_FunctionCalled would be “B_GCEntryNamesThisLang” and i_SelfTitle would be SubttileYourVideo and i_input6 would be “FromAPI”, plus the required variables indicated by star (*). Just ask our software developers for function names, or request customized functions.

For a simple (not complex) test call: B_LanguagesAvailableXML this is a very simple call for a list of world languages and will return a POST variable o_output1 an XML that looks like this:

<languagecategories>
<category name=“Group Languages>
<group name=“ArabEG></group>
<group name=“DutcNE></group>
<group name=“EnglUK></group>
<group name=“EnglUS></group>
<group name=“FrenCA></group>
<group name=“FrenEU></group>
<group name=“GermNE></group>
<group name=“MandMA></group>
<group name=“Norweg></group>
<group name=“Polish></group>
<group name=“Russia></group>
<group name=“SpanNE></group>
<group name=“SpanSP></group>
<group name=“Swedis></group>
<group name=“Urdu></group>
</category>
</languagecategories>
(Note: There are 200 categories of languages. See “Add Languages” feature of any TYW software.)

 

USING THE ABOVE:

If you don't have your unique API Key, please request one. The API Key is a long series of numbers and letters. For this example, we'll assume the API key is 111111111AAAAAAABBBBBBB
When sending variables using POST, the URL will be:
https://www.translateyourworld.eu/apis/resthtml/111111111AAAAAAABBBBBBB
FLEX EXAMPLE:
in the httpService request, the URL will be the POST URL above and the result will be an XML:
<HTTPService id="sendvars" url="https://www.translateyourworld.eu/apis/resthtml/111111111AAAAAAABBBBBBB" resultFormat="e4x" useProxy="false" result="trace(event.result)" />

Post variables:
When sending POST variables to the httpService URL, there are various ways to do this. Using the example above your function may look like this:
public function postVars():void{
sendvars.send({methodName: 'B_Method',
i_MasterLanguage: 'EnglUS',
i_UserID: '1234',
i_ProjectId: '555',
});
}
HTML EXAMPLE:
Using the same POST URL, the form tag would look like this:
<form method='POST' action="https://www.translateyourworld.eu/apis/resthtml/111111111AAAAAAABBBBBBB">

 


Email with questions