Skip to main content
This guide extends Quick Start with production behavior and optional capabilities.

At a glance

Recommended implementation order:
  1. Authentication and token refresh
  2. Import (project/job creation)
  3. Monitoring (webhook-first)
  4. Export and DELIVERED status
  5. Optional extensions and hardening

Prerequisites

  • Completed Quick Start.
  • Phrase TMS project template(s) aligned to your workflow.
  • Platform and TMS API base URLs for your tenant/region.
  • Secure storage for API token and runtime secrets.
  • A callback/webhook endpoint if you use push-based progress handling.
If you only need a baseline production flow, implement sections 1-4 first. Sections 5+ are optional hardening and scaling improvements.

1) Authentication strategy

  • Base flow: POST ${PLATFORM_BASE_URL}/idm/oauth/token (token exchange).
  • Include Authorization: Bearer <access_token> on API requests.
  • Refresh on expiry and on a single retry after 401.
For production, cache token expiry and centralize token refresh to avoid refresh storms under load.
Reference:

2) Import content into TMS

Required path

  1. List templates: GET /api2/v1/projectTemplates
  2. Create project: POST /api2/v2/projects/applyTemplate/{templateUid}
  3. Create jobs: POST /api2/v1/projects/{projectUid}/jobs
Persist templateUid, projectUid, job.uid, and relevant asyncRequest.id values.
Need payload examples while implementing? Jump to Optional reference: payloads and endpoint map.

Live preview integration point (optional)

If you use live preview, integrate it in this import phase:
  1. Upload a preview package after project creation.
  2. Store the returned preview package file UID.
  3. Include jobPreviewPackageFileUidRef when creating the job.
See Live Preview for implementation details and failure handling.

Optional path: expose content listing/download endpoints

If your integration uses TMS pull behavior from the third-party system:
  • Expose a list endpoint to return selectable content.
  • Expose a download endpoint to return encoded content for import.
  • Validate auth and return clear HTTP errors for invalid requests.
Keep endpoint responses deterministic. Stable IDs and filenames reduce duplicate imports and debugging complexity.
Reference:

Optional workflow extensions

If your lifecycle requires vendor automation and PM workflow support, add these operations after job creation:
  • Assign providers from template: POST /api2/v1/projects/{projectUid}/applyTemplate/{templateUid}/assignProviders
  • Create analyses by providers: POST /api2/v1/analyses/byProviders
  • Notify assigned users: POST /api2/v1/projects/{projectUid}/jobs/notifyAssigned
Reference:

3) Monitor job progress

Use this priority order:
  1. Webhooks (recommended for production)
  2. Async request status polling
  3. Job-part polling fallback

Webhooks

  • Configure webhook subscriptions for job/part/async lifecycle events.
  • Verify sender token/header.
  • Store events idempotently, acknowledge quickly, and process asynchronously.

Async status

  • Poll GET /api2/v1/async/{asyncRequestId} for completion when the workflow uses async endpoints.

Callback pattern (alternative to polling)

Many async endpoints support callbackUrl.
  • Callback payload includes async request metadata and action result.
  • Callback endpoint should validate sender, persist event, and return 200 quickly.
  • If callback URL is unreachable, Phrase retries after 2, 4, 8, 16, and 30 minutes (up to 10 failed retries).
  • Callback delivery is considered successful only when your endpoint returns HTTP 200.
Callback handler pseudocode:
POST /callbacks/phrase-async
  verifySignatureOrToken(request)
  event = parseJson(request.body)
  saveEventIdempotently(event.asyncRequest.id)
  enqueueAsyncProcessing(event)
  return 200

Job-part status fallback

  • Poll GET /api2/v1/projects/{projectUid}/jobs/{jobUid}/parts with backoff and jitter.
Reference:

Job status reference

Use this table to map statuses to plugin behavior.
StatusTypical phaseMeaningPlugin action
NEWCreation / pre-assignmentJob exists and is not yet acceptedKeep monitoring and surface as queued
ACCEPTEDAssignmentProvider accepted the jobContinue monitoring workflow progress
DECLINEDAssignmentProvider declined the jobReassign provider or notify operator
COMPLETEDCompletionTranslation workflow is completeStart export flow
DELIVEREDPost-exportTarget content was exported/imported successfullyTreat as terminal success
CANCELLEDExceptionWork was stopped before completionTreat as terminal failure
REJECTEDException / QAOutput was rejected and needs reworkRoute for rework, do not deliver
JOB_NOT_READYImport exceptionJob creation/import did not complete correctlyInspect import errors and retry safely

4) Export translated content

Pull from TMS via API

  1. Start async export: PUT /api2/v3/projects/{projectUid}/jobs/{jobUid}/targetFile
  2. Wait for completion via webhook/callback/polling.
  3. Download file once ready: GET /api2/v2/projects/{projectUid}/jobs/{jobUid}/downloadTargetFile/{asyncRequestId}
  4. Import result into third-party system.
  5. Set terminal status: POST /api2/v1/projects/{projectUid}/jobs/{jobUid}/setStatus with DELIVERED.

Push from TMS to your plugin (optional)

Expose a secure endpoint to receive translated payloads and run your import mapping there.
asyncRequestId for download is single-use. Persist and consume it carefully.
Reference:

5) Continuous updates (optional, high-change workflows)

For continuous localization, update source content on existing jobs and re-run the workflow:
  • Use POST /api2/v1/projects/{projectUid}/jobs/source
  • Monitor completion using callbacks, webhooks, or async polling.
  • Re-export translated output when updates finish.
Reference:

6) Metadata and reporting

Send plugin metadata in the Memsource header payload when creating jobs:
{
  "sourceData": {
    "clientType": "MY_PLUGIN",
    "clientVersion": "1.2.4",
    "hostVersion": "4.5.2"
  }
}
  • clientType is required and must be registered with Phrase.
  • clientVersion and hostVersion are optional.

7) Idempotency implementation guidance

Implement idempotency for all create and delivery operations:
OperationRecommended idempotency key
Create projectExternal content batch ID + template ID
Upload/create jobSource content checksum + locale + project ID
Start exportJob ID + source revision
Download/import target fileAsync request ID + target system item ID
Update status (DELIVERED)Job ID + delivered revision
Pattern:
  1. Build deterministic operation key before API call.
  2. Check/store key in durable storage with operation state.
  3. If duplicate key appears, return previously stored result instead of replaying.

8) Logging field specification

Log these fields for every API call and lifecycle event:
FieldWhy it matters
timestampEvent ordering and latency analysis
requestIdTie plugin logs to HTTP calls
correlationIdTrace a single localization flow end-to-end
projectUidProject-level troubleshooting
jobUidJob-level troubleshooting
asyncRequestIdAsync lifecycle correlation
pluginInstanceIdMulti-instance debugging
endpoint + methodAPI behavior visibility
statusCodeError and retry analytics
durationMsPerformance and SLO measurement

Plugin variants

CapabilityCanonical pluginLive content pluginContinuous localization plugin
Token exchange + refreshMustMustMust
Project from templateMustMustMust
WebhooksShouldMustMust
Live previewCanMustCan
Idempotent source updatesShouldMustMust
Advanced observabilityShouldMustMust

Operational hardening checklist

  • Retry transient errors (429, 5xx) with exponential backoff + jitter.
  • Avoid duplicate create/export actions with idempotency keys or dedupe logic.
  • Log correlation IDs, project/job IDs, endpoint, status, and latency.
  • Track success rates and error rates for create/monitor/export operations.
  • Add alerts for repeated failures and webhook delivery issues.

Testing expectations

  • Happy path: create → monitor → export → DELIVERED.
  • Failure path: auth errors, validation errors, rate limits, service errors.
  • Resilience path: webhook miss + polling fallback.
  • Update path (if enabled): source updates and repeated export.

Optional reference: payloads and endpoint map

Core payload snippets

Create project from template request:
{
  "name": "Website Translation",
  "sourceLang": "en",
  "targetLangs": ["de", "fr"]
}
Create project from template response (excerpt):
{
  "uid": "proj-uid-1",
  "name": "Website Translation",
  "status": "NEW",
  "sourceLang": "en",
  "targetLangs": ["de", "fr"]
}
Create job response (excerpt):
{
  "jobs": [
    {
      "uid": "job-uid-1",
      "status": "NEW",
      "targetLang": "de"
    }
  ],
  "asyncRequest": {
    "id": "async-req-1",
    "action": "PRE_ANALYSE"
  }
}
Set job status request:
{
  "requestedStatus": "DELIVERED",
  "notifyOwner": true,
  "propagateStatus": true
}

Endpoint reference glossary

ActionMethodEndpoint
Exchange API token for access tokenPOST${PLATFORM_BASE_URL}/idm/oauth/token
List project templatesGET/api2/v1/projectTemplates
Create project from templatePOST/api2/v2/projects/applyTemplate/{templateUid}
Create jobPOST/api2/v1/projects/{projectUid}/jobs
Assign providers from templatePOST/api2/v1/projects/{projectUid}/applyTemplate/{templateUid}/assignProviders
Create analyses by providersPOST/api2/v1/analyses/byProviders
Notify assigned usersPOST/api2/v1/projects/{projectUid}/jobs/notifyAssigned
Get async requestGET/api2/v1/async/{asyncRequestId}
List job partsGET/api2/v1/projects/{projectUid}/jobs/{jobUid}/parts
Start async target-file exportPUT/api2/v3/projects/{projectUid}/jobs/{jobUid}/targetFile
Download target file by async requestGET/api2/v2/projects/{projectUid}/jobs/{jobUid}/downloadTargetFile/{asyncRequestId}
Set job statusPOST/api2/v1/projects/{projectUid}/jobs/{jobUid}/setStatus
Update source for continuous localizationPOST/api2/v1/projects/{projectUid}/jobs/source
For complete request/response schemas, use the linked endpoint pages and the TMS API reference.

Additional resources

Next steps

Live Preview

Add context-rich in-editor preview behavior.

Error Handling & Limits

Confirm failure handling and limit-safe behavior.

API Reference (TMS Latest)

Review endpoint-level request and response details.