A PHP OpenText API Client.

v0.0.4 2020-07-29 18:36 UTC

This package is auto-updated.

Last update: 2024-06-13 03:26:07 UTC


Build Status

A PHP OpenText API client.


  • PHP >= 7.1
  • ext-json

You must also enable the REST API in your administrator configuration.

This is usually located at:


Enable the REST API (default): [x]


composer require fbclit/opentextapi




use Fbcl\OpenTextApi\Client;

$client = new Client('https://server.com/otcs/cs.exe', 'v1');

try {
    $client->connect('username', 'secret', $ntlm = true);

} catch (\Exception $ex) {
    // Could not connect / authenticate.

Uploading a File

OpenText does not support uploading files normally through POST requests. It only supports streamed file uploads through asynchronous JavaScript requests.

To perform a file upload, you must place the file on the web server server in your OpenText configured Uploads directory. This directory is configured in the admin web interface at:


Upload Directory Enter the directory specification for temporary storage of documents added to Content Server (optional). If specified, the Content Server will only add uploaded files found in this directory.

Usually this is set to the D:\Upload folder.



use Fbcl\OpenTextApi\Client;

$client = new Client('http://server.com/otcs/cs.exe', 'v1');

$client->connect('username', 'secret');

$api = $client->api();

try {
    // The folder node ID of where the file will be created under.
    $parentNodeId = '12356';

    // The file name to display in OpenText
    $fileName = 'My Document.txt';

    // The actual file path of the file on the OpenText server.
    $serverFilePath = 'D:\Upload\My Document.txt';
    $response = $api->createNodeDocument($parentNodeId, $fileName, $serverFilePath);

    if (isset($response['id'])) {
        // The ID of the newly created document will be returned.
        echo $response['id']; 
} catch (\Exception $ex) {
    // File not found on server drive, or issue creating node from given parent.