IMPORTANT: If you want your API key to be encrypted please remember to use the HTTPS protocol!
Translations can be ordered and retrieved over the API for media files that have original transcripts in the 3Play Media system. The best practice is to proofread prior to ordering, as all orders are final/cannot be canceled.
The source media file can be referenced by the 3Play Media unique :file_id, or your own tracking ID, populated as :video_id in the account system.
List Translations for a File using 3Play :file_id or Your :video_id
[GET] http://static.3playmedia.com/files/:file_id/translations?apikey=:api_key
[GET] http://static.3playmedia.com/files/:video_id/translations?apikey=:api_key&usevideoid=1
Sample result for a file that has been translated from English to Korean and Japanese
[{
id: 1234567890,
translation_service_id: 54,
source_language_name: "English",
source_language_iso_639_1_code: "en",
target_language_name: "Korean",
target_language_iso_639_1_code: "ko",
state: "complete"
},
{
id: 1234567891,
translation_service_id: 34,
source_language_name: "English",
source_language_iso_639_1_code: "en",
target_language_name: "Japanese",
target_language_iso_639_1_code: "ja",
state: "complete”
}]
Get Translation Status for File by Video ID
For an individual translation, you can display the source and target language attributes, as well as the current state of the translation job.
[GET] http://static.3playmedia.com/files/:file_id/translations/:translation_id?apikey=:api_key
[GET] http://static.3playmedia.com/files/:video_id/translations/:translation_id?apikey=:api_key&usevideoid=1
Download Translated Transcript
All formats that are available for source transcripts are available for translations. In this example, we are downloading a plain text version of the transcript.
[GET]http://static.3playmedia.com/files/:file_id/translations/:translation_service_option_id/transcript.txt?apikey=:api_key
The translation_service_option_id is returned as the translation_service_id from here:
[GET] http://static.3playmedia.com/files/:file_id/translations?apikey=:api_key
Download Translated Captions
All formats that are available for source captions are available for completed translations. In this example, we are downloading a SRT version of the captions.
[GET] http://static.3playmedia.com/files/:file_id/translations/:translation_id/captions.srt?apikey=:api_key
[GET] http://static.3playmedia.com/files/:video_id/translations/:translation_id/captions.srt?apikey=:api_key&usevideoid=1
List Available Translation Services
To view a list of available translation services, use the following API method. Each result will describe the source language, target language, service level, and price rate for the translation service. Use the “id” attribute as the “translation_service_id” when ordering a translation for a media file.
[GET] http://static.3playmedia.com/translation_services?apikey=:apikey
Order a Translation
You can order a translation for a source file with the order translations method.
[POST] http://api.3playmedia.com/files/:file_id/translations/order?translation_service_id=#&apikey=
Required attribute:
translation_service_id
Sample response (success)
{success: true, translation_id: 1234567890, errors: []}
Sample response (error)
In this case, someone is trying to order a translation without sending the required translation_service_id parameter
{success: false, translation_id: “”, errors: [“Can not order a translation without translation_service_id"]}
0 Comments