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:
Or get the source directly:
- Repository: https://github.com/Eurotext/rest-integration
- Latest release (ZIP): https://github.com/Eurotext/rest-integration/releases/latest
Requires PHP 8.1+ and guzzlehttp/guzzle ^7.8.
The workflow in one minute¶
- Create a project —
POST /project(type: orderto commission, orquotefor an estimate). - Add items —
POST /project/{id}/item, one per source unit. All items must be added before the next step. - Start —
PATCH /transition/project/{id}withstatus: new. The project is now locked. - Poll or get a webhook —
GET /project/{id}until every item isfinished. - Fetch results —
GET /project/{id}/item/{itemId}; the translation is undertranslation, keyed like yourbody.
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