Skip to content

Eurotext v2 REST API — Integration Kit

A small, dependency-light reference client and developer documentation for connecting a system to the Eurotext v2 REST API (translation projects).

The client is a straight, synchronous PHP port of production code that talks to the Eurotext API. It's framework-agnostic and drops cleanly into a Symfony/Akeneo connector, a CLI command, or a queue worker.

Install / download

Published on Packagist:

composer require eurotext/rest-integration

Or get the source directly:

Requires PHP 8.1+ and guzzlehttp/guzzle ^7.8.

The workflow in one minute

  1. Create a projectPOST /project (type: order to commission, or quote for an estimate).
  2. Add itemsPOST /project/{id}/item, one per source unit. All items must be added before the next step.
  3. StartPATCH /transition/project/{id} with status: new. The project is now locked.
  4. Poll or get a webhookGET /project/{id} until every item is finished.
  5. Fetch resultsGET /project/{id}/item/{itemId}; the translation is under translation, keyed like your body.

The order is mandatory — see Workflow.

Quickstart

use Eurotext\EurotextClient;
use Eurotext\LanguageMap;
use Eurotext\ProjectStatus;

$client = new EurotextClient($apiKey); // stage by default

$project = $client->createProject('My project', type: 'order');
$client->createItem(
    projectId: (int) $project['id'],
    sourceLanguage: LanguageMap::toEurotext('de-DE'), // -> de-de
    targetLanguage: LanguageMap::toEurotext('fr-FR'), // -> fr-fr
    textType: 'product',
    body: ['name' => 'Roter Stuhl', '__meta' => ['id_in_your_system' => 42]],
);
$client->transitionProject((int) $project['id'], 'new'); // start translation

// ...later, from a cron/queue job:
$status = ProjectStatus::fromProject($client->getProject((int) $project['id']));

Where to go next

  • Overview — the object model and integration shape
  • Authentication — token and environments
  • Workflow — the full, mandatory sequence
  • Endpoints — every call with real request/response bodies
  • Pitfalls — the non-obvious things, up front