Jollo API Documentation (v1.1, june 15 2009)
1.0 Overview
API TYPE - Jollo uses a simple GET API with standard URL ENCODING. "http://www.jollo.com/api/translate.php?" is used to read and write translations in real-time, and "http://www.jollo.com/api/viewphrase.php?" is used to read translations from the phrasebook.AUTHENTICATION - There is no authentication required to translate phrases, however there is authentication (HTTPS) required if users wish to add phrases and translations to Jollo. The API adds all requested phrase translations to the user's favorite phrase list (personal phrasebook) automatically. The API also creates new phrases for authenticated users if they do not previously exist.
TRANSLATION RESULTS - Jollo returns either machine translations or both machine and human translations (if they exist).
MACHINE TRANSLATION ENGINES - Currently Jollo supports google, yahoo, worldlingo, microsoft, youdao and sdl machine translation engines.
2.0 Response Codes
| Tag | Description |
| <JolloResponse></JolloResponse> | Beginning and ending of the response |
| <phrase_created></phrase_created> | Only shown with value "true" if this phrase was created as a result of this request |
| <PhraseID></PhraseID> | Unique phrase id |
| <SL></SL> | Source language |
| <TL></TL> | Target language |
| <Translation></Translation> | Translation element |
| <translation_created></translation_created> | Only shown with value "true" if this translation was created as a result of this request |
| <Engine></Engine> | "true" for machine translation, "false" for human translation |
| <Username></Username> | Author's username for this translation. Can be human or a machine translaion engine. |
| <ScoreUp></ScoreUp> | Number of "Up" votes for this translation |
| <ScoreDown></ScoreDown> | Number of "Down" votes for this translation |
| <Result></Result> | Translation text |
| <Created_date></Created_date> | Creation date of this translation. (Only used for viewphrase.php? api) |
| <Error></Error> | Shows error messages |
3.0 Arguments for "http://www.jollo.com/api/translate.php?"
| Argument | Description |
| st | The source text to be translated. Use standard URL Encoding, for example to seperate words you can use "hello%20world" or "hello+world". |
| tl | The target language code. Please click here for Jollo's supported languages and codes |
| OutputStyle | At present only the "XML" value is supported |
| sl (optional) | The source language code. Please click here for Jollo's supported languages and codes |
| engine (optional) | Specify which engines to use,seperated by comma. Valid codes are 'HM' (human), 'GG' (google), 'ML' (microsoft), 'WL' (worldlingo), 'YD' (youdao), 'YBF' (yahoo Babelfish) |
| User (optional) | Jollo username. Requires "Password". Requires HTTPS. |
| Password (optional) | Jollo member password. Requires "User". Requires HTTPS. |
| onlyAddHumanTranslations (optional) | The value is either "yes", if a human translation is required, or "no" if either a human or machine translation is acceptable |
| myTranslation (optional) | Translation for given source text and target language. Requires "User" and "Password". |
| ddCategory (optional) | Category ID. Please click here for Jollo's supported categories |
| RequestID (optional) | Unique ID that is echoed back. Useful when waiting for human translations |
4.0 Examples
4.1 Translate English->French
Query:http://www.jollo.com/api/translate.php?st=i+miss+you&sl=en&tl=fr&OutputStyle=XMLExpected Response:
<JolloResponse> <PhraseID>1495</PhraseID> <SL>en</SL> <TL>fr</TL> <Translation> <Engine>false</Engine> <Username>jollo_membername</Username> <ScoreUp>7</ScoreUp> <ScoreDown>2</ScoreDown> <Result>tu me manques</Result> </Translation> <Translation> <Engine>true</Engine> <Username>google</Username> <ScoreUp>7</ScoreUp> <ScoreDown>2</ScoreDown> <Result>tu me manques</Result> </Translation> <Translation> <Engine>true</Engine> <Username>yahoo</Username> <ScoreUp>2</ScoreUp> <ScoreDown>5</ScoreDown> <Result>je vous manque</Result> </Translation> <Translation> <Engine>true</Engine> <Username>sdl</Username> <ScoreUp>7</ScoreUp> <ScoreDown>2</ScoreDown> <Result>je vous manque</Result> </Translation> <Translation> <Engine>true</Engine> <Username>worldlingo</Username> <ScoreUp>2</ScoreUp> <ScoreDown>5</ScoreDown> <Result>je vous manque</Result> </Translation> </JolloResponse>
4.2 Translate Auto-detect->French
Query:http://www.jollo.com/api/translate.php?st=i+miss+you&tl=fr&OutputStyle=XMLExpected Response:
Same as above.
4.3 Authenticated user request (HTTPS)
Query:https://www.jollo.com/api/translate.php?st=source+text&tl=fr&OutputStyle=XML&User=username&Password=passwordExpected Response:
<JolloResponse> <PhraseID>phraseid</PhraseID> <SL>en</SL> <TL>fr</TL> <Translation> <Engine>false</Engine> <Username>jollo_member</Username> <ScoreUp>7</ScoreUp> <ScoreDown>2</ScoreDown> <Result>result</Result> </Translation> <Translation> <Engine>true</Engine> <Username>google</Username> <ScoreUp>7</ScoreUp> <ScoreDown>2</ScoreDown> <Result>result</Result> </Translation> <Translation> <Engine>true</Engine> <Username>yahoo</Username> <ScoreUp>2</ScoreUp> <ScoreDown>5</ScoreDown> <Result>result</Result> </Translation> <Translation> <Engine>true</Engine> <Username>sdl</Username> <ScoreUp>7</ScoreUp> <ScoreDown>2</ScoreDown> <Result>result</Result> </Translation> <Translation> <Engine>true</Engine> <Username>worldlingo</Username> <ScoreUp>2</ScoreUp> <ScoreDown>5</ScoreDown> <Result>result</Result> </Translation> </JolloResponse>
4.4 Authenticated user request (HTTPS) | New phrase translation created
Query:https://www.jollo.com/api/translate.php?st=source+text&tl=fr&OutpuCreation date of this translation. (Only used for viewphrase.php? api)username&Password=passwordExpected Response:
<JolloResponse> <phrase_created> true <phrase_created/> <PhraseID>phraseid</PhraseID> <SL>en</SL> <TL>fr</TL> <Translation> <Engine>true</Engine> <Username>google</Username> <ScoreUp>7</ScoreUp> <ScoreDown>2</ScoreDown> <Result>result</Result> <translation_created> true <translation_created/> </Translation> <Translation> <Engine>true</Engine> <Username>yahoo</Username> <ScoreUp>2</ScoreUp> <ScoreDown>5</ScoreDown> <Result>result</Result> </Translation> <Translation> <Engine>true</Engine> <Username>sdl</Username> <ScoreUp>7</ScoreUp> <ScoreDown>2</ScoreDown> <Result>result</Result> </Translation> <Translation> <Engine>true</Engine> <Username>worldlingo</Username> <ScoreUp>2</ScoreUp> <ScoreDown>5</ScoreDown> <Result>result</Result> </Translation> </JolloResponse>
4.5 Authenticated user adds a new human translation (HTTPS)
Query:https://www.jollo.com/api/translate.php?st=source+text&tl=fr&OutputStyle=XML&User=fred&Password=password &myTranslation=target+textExpected Response:
<JolloResponse> <phrase_created> true <phrase_created/> <PhraseID>phraseid</PhraseID> <SL>en</SL> <TL>fr</TL> <Translation> <Engine>false</Engine> <Username>fred</Username> <ScoreUp>7</ScoreUp> <ScoreDown>2</ScoreDown> <Result>target text</Result> <translation_created> true <translation_created/> </Translation> <Translation> <Engine>true</Engine> <Username>google</Username> <ScoreUp>7</ScoreUp> <ScoreDown>2</ScoreDown> <Result>result</Result> </Translation> <Translation> <Engine>true</Engine> <Username>yahoo</Username> <ScoreUp>2</ScoreUp> <ScoreDown>5</ScoreDown> <Result>result</Result> </Translation> <Translation> <Engine>true</Engine> <Username>sdl</Username> <ScoreUp>7</ScoreUp> <ScoreDown>2</ScoreDown> <Result>result</Result> </Translation> <Translation> <Engine>true</Engine> <Username>worldlingo</Username> <ScoreUp>2</ScoreUp> <ScoreDown>5</ScoreDown> <Result>result</Result> </Translation> </JolloResponse>
5.0 Error Codes
| Error Type | Description |
| 1: Invalid source or target language | The source or target language is not valid |
| 2: Missing source text | The source text required argument is missing |
| 3: Source text too short | The source text is too short |
| 4: Invalid Username or Password | The username or password is invalid |
| 5: HTTPS Authentication required with valid Username and Password | HTTPS (e.g. https://URL) Authentication is required with Username and Password arguments. |
| 6: Translation not added. General failure | The translation was not added to the Jollo database |
| 7: Translation not added. Translation already exists | The translation already exists and was not added to the Jollo database |
| 8: Phrase not added. General failure | The phrase was not added to the Jollo database |
| 9: Phrase not added. Phrase already exists | The phrase already exists and was not added to the Jollo database |
| 10: Invalid OutputStyle | The OutputStyle is invalid |
| 11: Invalid CategoryID | The CategoryID is invalid |
| 12: Invalid onlyAddHumanTranslations | onlyAddHumanTranslations can only have values "yes" or "no" |
| 13: Invalid engine code(s) | Please follow the engine codes specified in the Arguments section. |
| 14: Argument(s) not recognized | Please use valid arguments, as specified by the API |
6.0 Arguments for "http://www.jollo.com/api/viewphrase.php?"
| Argument | Description |
| PhraseID | Unique phrase id |
| OutputStyle | At present only the "XML" value is supported |
| TranslationCount (optional) | The maximum number of translations displayed for a given phrase. Results will be ordered according to translation accuracy. |
| TranslationList (optional) | This has single value of "true". Only translation ids are returned. |
7.0 Examples
7.1 View translations for phrase id 2405
Query:http://www.jollo.com/api/viewphrase.php?phraseid=2405&OutputStyle=XMLExpected Response:
<JolloResponse> <PhraseID>2405</PhraseID> <SL>en</SL> <Translation> <TranslationID>3047<TranslationID> <TL>it</TL> <Engine>true</Engine> <Username>google</Username> <ScoreUp>0</ScoreUp> <ScoreDown>0</ScoreDown> <Result>Camminare in silenzio, Non a piedi, in silenzio. Vedi il pericolo, Sempre il pericolo, Endless parlare, Vita di ricostruzione, Non a piedi.</Result> </Translation> </JolloResponse>
7.2 View 3 translations for phrase id 1272 | Only show translation ids
Query:http://www.jollo.com/api/viewphrase.php?id=1272&OutputStyle=XML&TranslationCount=3&TranslationList=trueExpected Response:
<JolloResponse> <PhraseID>1272</PhraseID> <SL>en</SL> <Translation> <TranslationID>2615<TranslationID> <TL>zh</TL> <Created_date>2009-03-09 01:26:26 UTC<Created_date> <Username>google<Username> </Translation> <Translation> <TranslationID>2131<TranslationID> <TL>zh</TL> <Created_date>30472008-12-11 09:58:51 UTC<Created_date> <Username>anonymous<Username> </Translation> <Translation> <TranslationID>2121<TranslationID> <TL>zh</TL> <Created_date>2008-12-10 13:16:30 UTC<Created_date> <Username>anonymous<Username> </Translation> <Translation> </Translation> </JolloResponse>
2009 Copyright, Jollo.com.
All rights reserved under law.
User contributions are licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.
User contributions are licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.