PHPackages                             openeuropa/cdt-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. openeuropa/cdt-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

openeuropa/cdt-client
=====================

A PHP client library for communicating with the CDT service.

1.0.0(6mo ago)131↓50%EUPL-1.2PHPPHP &gt;=8.1CI passing

Since Nov 18Pushed 1mo ago9 watchersCompare

[ Source](https://github.com/openeuropa/cdt-client)[ Packagist](https://packagist.org/packages/openeuropa/cdt-client)[ RSS](/packages/openeuropa-cdt-client/feed)WikiDiscussions 1.x Synced 1w ago

READMEChangelog (1)Dependencies (10)Versions (3)Used By (0)

OpenEuropa CDT Client
=====================

[](#openeuropa-cdt-client)

[![Build Status](https://camo.githubusercontent.com/079f9ee39d29a953be6bf7ebdfc1c34a884a4025b378cac2dbc1f69e7a86ba14/68747470733a2f2f64726f6e652e66706669732e65752f6170692f6261646765732f6f70656e6575726f70612f6364742d636c69656e742f7374617475732e737667)](https://drone.fpfis.eu/openeuropa/cdt-client)[![Packagist](https://camo.githubusercontent.com/e037d53e50e4a87fa5240f1bd6794666348568948fe98a1987503cdf09398856/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f70656e6575726f70612f6364742d636c69656e742e737667)](https://packagist.org/packages/openeuropa/cdt-client)

Description
-----------

[](#description)

*CDT Client* is a library offering a PHP API to consume Translation Centre For the Bodies of the EU services.

Install
-------

[](#install)

Use [Composer](https://getcomposer.org/) to install the package:

```
$ composer require openeuropa/cdt-client
```

Usage
-----

[](#usage)

All calls should be done by instantiating the client class:

```
require_once 'vendor/autoload.php';

$client = new \OpenEuropa\CdtClient\ApiClient(
    new \GuzzleHttp\Client(),
    new \GuzzleHttp\Psr7\HttpFactory(),
    new \GuzzleHttp\Psr7\HttpFactory(),
    [
        // For a full list of options see "Configuration".
        'apiBaseUrl' => 'https://example.com',
        'username' => 'your-user-name',
        'password' => 'your-password',
        'client' => 'client-name',
    ]
);
```

In the above example, we're passing the Guzzle HTTP client, request, stream and URI factories. But these can be replaced by any similar factories that are implementing the PSR interfaces. The last parameter is the configuration.

### Configuration

[](#configuration)

Possible configurations:

- `username` (string): Used for authentication.
- `password` (string): Used for authentication.
- `client` (string): Used for authentication.
- `apiBaseUrl` (string, valid URI): The base API url.

### Check connection

[](#check-connection)

```
$response = $client->checkConnection();
```

Will return true or false depending on the availability of the CDT service.

### Get reference data

[](#get-reference-data)

```
$response = $client->getReferenceData();
```

Will return an array of business reference data, serialized into `OpenEuropa\CdtClient\Model\Response\ReferenceData`.

### Translation requests

[](#translation-requests)

To validate and send a translation request, run the following code:

```
use OpenEuropa\CdtClient\Model\Request\Translation;
use OpenEuropa\CdtClient\Exception\ValidationErrorsException;

$translationRequest = new Translation()
try {
    if ($client->validateTranslationRequest($translationRequest)) {
        $correlationId = $client->sendTranslationRequest($translationRequest);
    }
} catch (ValidationErrorsException $e) {
    $errors = $e->getValidationErrors();
    // Handle the errors.
}
```

On success, the `sendTranslationRequest()` method will return the temporary Correlation ID.

### Get permanent request identifier

[](#get-permanent-request-identifier)

```
$permanentId = $client->getPermanentIdentifier($correlationId);
```

Will return a permanent string identifier for the translation request, based on correlation ID. Throws the `ValidationErrorsException` if the correlation ID is not found.

### Get the status of a translation request

[](#get-the-status-of-a-translation-request)

```
$translationStatus = $client->getRequestStatus($permanentId);
```

Will return information on the status of translation request, based on permanent ID. The information includes the list of files to download. Throws the `ValidationErrorsException` if the permanent ID is invalid.

### Download the file (source or translated)

[](#download-the-file-source-or-translated)

```
$file = $client->downloadFile($fileUrl);
```

Downloads the specified file, if available, based on the filename listed in `getRequestStatus()`. Throws a `ValidationErrorsException` if the filename is invalid.

Contributing
------------

[](#contributing)

Please read [the full documentation](https://github.com/openeuropa/openeuropa) for details on our code of conduct, and the process for submitting pull requests to us.

Versioning
----------

[](#versioning)

We use [SemVer](http://semver.org/) for versioning.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance79

Regular maintenance activity

Popularity12

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

203d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d3b1f4079f9a82f6dd88fe6577d1256b4ecbbccbcd4a4ec9bea7c2fd6f72b99a?d=identicon)[DIGIT-CORE](/maintainers/DIGIT-CORE)

---

Top Contributors

[![intelektron](https://avatars.githubusercontent.com/u/3647601?v=4)](https://github.com/intelektron "intelektron (151 commits)")[![drishu](https://avatars.githubusercontent.com/u/11507647?v=4)](https://github.com/drishu "drishu (27 commits)")[![brummbar](https://avatars.githubusercontent.com/u/8488617?v=4)](https://github.com/brummbar "brummbar (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/openeuropa-cdt-client/health.svg)

```
[![Health](https://phpackages.com/badges/openeuropa-cdt-client/health.svg)](https://phpackages.com/packages/openeuropa-cdt-client)
```

###  Alternatives

[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1715.6k12](/packages/2lenet-crudit-bundle)[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k50.1M306](/packages/api-platform-core)[web-auth/webauthn-lib

FIDO2/Webauthn Support For PHP

1237.8M117](/packages/web-auth-webauthn-lib)[api-platform/symfony

Symfony API Platform integration

354.0M107](/packages/api-platform-symfony)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

51090.8k2](/packages/web-auth-webauthn-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
