DTXS API DTXS Client

DTXS Client

Open source DTXS client

There is a sample open source PHP implementation of the DTXS client available. You may contribute via Github to implement clients in other technologies.

The source code is available at  https://github.com/wai-blue/dtxs-client.

PHP

To use the PHP client, you need to have installed PHP 8.x and composer (package manager for open source PHP libraries,  https://getcomposer.org).

Install the client

Having these prerequisities ready, run following commands to perform the test:

Step Command
Clone the DTXS client repository git clone https://github.com/wai-blue/dtxs-client
Navigate to the cloned folder cd dtxs-client
Install 3rd-party libraries for PHP composer install

List of commands to install the DTXS client

Now you should have following files and folders in your dtxs-client folder (see the vendor folder and composer.lock file - they have been created by composer):

dtxs-client
  /clients
  /vendor
  /.gitignore
  /composer.json
  /composer.lock
  /LICENSE
  /README.md

Configure the test

To configure the test, type php clients/php/test.php in your terminal. You must be in the dtxs-client folder. The test script will navigate you through necessary configuration steps.

You will need to create a config.json file in the dtxs-client folder. To do this, follow these steps:

An example of the final config.json file:

{
  "dtxsClient": {
    "clientId": "YOUR_CLIENT_ID",
    "clientSecret": "YOUR_CLIENT_SECRET",
    "userName": "YOUR_USERNAME",
    "userPassword": "YOUR_PASSWORD",
    "oauthEndpoint": "https://platform.dorado-project.eu:29084/realms/DORADO/protocol/openid-connect",
    "dtxsEndpoint": "http://platform.dorado-project.eu:23741/api/v0.04"
  }
}

Run the test

Finally, if everything succeeds, you should be able to run the test with the command php clients/php/test.php and you should see following output:

DTXS-client CLI test script.

DTXS endpoint: YOUR_DTXS_ENDPOINT
OAUTH endpoint: YOUR_OAUTH_ENDPOINT
clientId: YOUR_CLIENT_ID
clientSecret: YOUR_CLIENT_SECRET
userName: YOUR_USERNAME

Authorizing...
Received access token received for the client 'YOUR_CLIENT_ID'. Length: 1055
What do you want to do? (Use 'help'' or 'h' for help) (no database is activated):
(C) wai.blue | Rendered using GuideVis