Integrating with Phrase TMS provides seamless content exchange between third-party systems and Phrase, which is critical for reducing manual labor, minimizing errors, and improving efficiency in translation processes. This integration is particularly beneficial for businesses with frequent updates and high-volume translation needs, enabling continuous localization and immediate availability of translated content in target languages.
When building an integration into Phrase from an external system, you’ll need to consider the following User Flow:
This covers the basic requirements for a Plugin into Phrase. There are other actions that may be included, such as canceling a Job that is currently “In Progress” or Assigning Vendors, handling multiple workflow steps or setting up a continuous monitoring and import based on a change to content in a 3rd party system. These additional use cases are not fully covered in this document, please review our API documentation to discover how to implement these additional requirements.
Phrase TMS supports a variety of file types for integration purposes, which include:
Additionally, Phrase supports various import options and parsing settings for these file types, which can be saved as custom file types and/or in project templates to optimize the integration setup.
Phrase TMS uses two main authentication methods for API access: API Token and OAuth 2.0.
auth/login
API to obtain a token, valid for 24 hours.ApiToken OKTiI2V7QqRDu0HADR2Fk2b9hCteI1pT06bOSk5OD8HSc3oCOHMzIgVtOtLV65hi
.POST /projects/applyTemplate
to create a project using a predefined template.POST /jobs
to create a job within the project.POST /jobs/{jobUid}/providers
to assign linguists or MT providers from the template.POST /jobs/{jobUid}/analyses
to perform word count and other analyses.POST /jobs/{jobUid}/notify
to notify assigned users about the new job.GET /jobs/{jobUid}/parts
to check the status of each job part.GET /asyncRequests/{asyncRequestId}
to check the status of asynchronous operations.GET /jobs/{jobUid}/targetFile
to download the translated file.POST /jobs/{jobUid}/status
to set the job status to DELIVERED, indicating that the content has been retrieved.One commonly desidered feature is Live Preview. Live preview is an HTML-based visual representation of localized content, accessible within the editor and navigable by segments. It provides translators and editors with additional context. Its content is updated as segments are localized (it is live in that sense).
There are different ways this can be achieved.
When creating a job in TMS, you have to specify the file format that you want to localize. If you choose HTML and upload HTML for localization, it will be rendered as a live preview in the editor. This is not necessarily feasible for all CMSs as they often organize content into fields that they represent in complicated data structures which would be difficult to convert to HTML and then back.
Since Option 1 is not always available, we’ve created an alternative approach that allows users to upload a separate preview package that will then be rendered as a part of the job. The steps you need to take are as follows:
https://google.com
) and assets linked in this way will be preserved but may not work correctly. This is intended to work around the issue of assets being unavailable via the Internet or requiring authentication for access.jobPreviewPackageFileUidRef
in the Memsource
header. Once the job is created, it should have a live preview created and visible in the editor.When integrating with the Phrase TMS API, you may encounter several common error codes. Here are the most frequent ones, along with their meanings and how to handle them
Error Code | Description | Meaning | Solution |
---|---|---|---|
401 | Unauthorized | Authentication failed. The request did not include the necessary authentication tokens or the provided token is invalid. | Ensure that the API token is correctly included in the Authorization header. If using OAuth, verify that the token has not expired and that the OAuth flow is correctly implemented. |
403 | Forbidden | The authenticated user does not have the necessary permissions to access the requested resource. | Check the user permissions and roles in Phrase TMS. Ensure that the API calls are being made by a user with adequate privileges. |
404 | Not Found | The requested resource does not exist. | Verify the endpoint URL and the resource identifiers (e.g., project ID, job ID) are correct. |
429 | Too Many Requests | The rate limit for API requests has been exceeded. | Implement exponential backoff in your retry logic. Ensure your application adheres to the rate limits by sending requests in smaller batches and spacing them out appropriately. |
500 | Internal Server Error | An unexpected error occurred on the server. | This is often a temporary issue. Implement retry logic with exponential backoff. If the issue persists, contact Phrase support with details of the request causing the error. |
400 | Bad Request | The request was invalid or cannot be otherwise served. | Verify the request parameters, headers, and body to ensure they conform to the API specifications. Common issues include missing required parameters or incorrect parameter types. |
503 | Service Unavailable | The server is currently unavailable (due to overload or maintenance). | Implement retry logic with exponential backoff. Check Phrase status page or contact support for more information on service availability. |
updateSource
endpoint for continuous localization to update only changed segments.
POST /api2/v1/projects/$project_id/jobs
for creating a job.Memsource
header, you can append a sourceData
object to the JSON:clientType
identifies the plugin type
clientVersion
holds the version of your plugin
hostVersion
holds the version of 3rd party system
Only the clientType
value is required, clientVersion
and hostVersion
are optional and only should be used if relevant.
The value used in clientType
needs to be registered with Phrase. Please reach out to us to register your plugin as a recognized client.
You can review all the terminology of Phrase products and terms in our help center. Here is a list of the major ones you’ll interact with:
Term | Definition |
---|---|
Project | Projects are where the main components of a translation project (jobs, translation memories, and term bases) are held together. Before files can be assigned for translation, they must be assigned to and contained within a project. |
Project Template | A project template is used in project creation. Repeating project criteria is maintained for regular clients, projects shared with Vendors, or projects created with the submitter portal. Use of a template streamlines the submission process and reduces errors. |
Job | A job represents a file for translation into a specified target language(s). If a single file is to be translated from a source into two target languages, it is represented by two jobs: Job 1 Translation of the file into English. Job 2 Translation of the file into Italian. |
Workflow | Workflow represents the life cycle of a document in the translation process; a sequence of consecutive steps which lead to a desired output. Workflow steps have a hierarchical structure determined by their order when set up. When a segment is edited in a workflow step, it is propagated to a higher workflow step. |
XLIFF | XLIFF stands for XML Localization Interchange File Format. A single interchange file has to be provided in a format that can be understood by any localization provider. XLIFF is the preferred way of exchanging data in XML format in the translation industry. |
Locale | Locale refers to the combination of a language and specific geographic region (usually a country) where terminology is adapted for specific content and design. Source being the starting language and Target being the translated to language. |
Machine translation | Machine translation (MT) is a software-based process that translates content from one language to another without human intervention. While it helps with quick translations, it doesn’t produce the same quality as manual, human translations. |
Markup language | Markup language refers to the different web languages (including HTML, XML, and XHTML) that specify the formatting, layout, and style of website content. It uses <tags> before and afterwords and phrases to specify formatting. For example, <b> this phrase is bold <b>. When translating, the content inside the tags is translated. |
Segment(ation) | Segmentation is the process of splitting translations into smaller, relevant chunks. It makes translators more efficient, translation memory richer and the experience better when localizing longer texts. |
Translation memory | A translation memory(TM) is a database that stores all your previous translations and will suggest translations for future projects to save time. |