tectly/openapi-client

This package is abandoned and no longer maintained. The author suggests using the tectly/client package instead.

PHP SDK for Tectly Floorplan Recognition API

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Forks: 0

pkg:composer/tectly/openapi-client

v1.4.0 2026-01-26 20:17 UTC

This package is auto-updated.

Last update: 2026-01-26 19:18:14 UTC


README

Tectly PHP Client

Tectly is an AI-powered floor-plan recognition service that can ingest virtually any floor plan format (scans, JPGs, PDFs, CAD files, or hand sketches) and automatically extract structural elements like walls, rooms, doors, windows, and measurements. It lets you edit the generated geometry in a browser, and offers export of structured building data (JSON, CSV, Excel) as well as integration via a REST API, SDKs, or embeddable web widget.

The Tectly PHP Client is a the PHP binding of the Tectly Rest API with some convenience functions for easy use.

Installation & Usage

Composer

Install the bindings via Composer using composer require tectly/client. This package requires PHP 8.1 or later.

Getting Started

The simplest way to get started is to use the TectlyClient. It authenticates with the given credentials and let's you follow the individual entities as they are processed.

use Tectly\OpenAPI\Model\ProcessingStatus;
use Tectly\OpenAPI\Model\ProjectCreate;
use Tectly\OpenAPI\TectlyClient;

$client = new TectlyClient(getenv('TECTLY_API_KEY'), getenv('TECTLY_API_SECRET'));
$documentFile = new SplFileObject(getenv('TECTLY_TEST_FILE'));

$project = $client->projectsApi->createProject(new ProjectCreate(['title' => 'My project']));
$document = $client->documentsApi->addDocument($project->getId(), $documentFile);

// Optionally:
// $db->persist($document->getId());
// $documentId = $db->getDocumentId();

$document = $client->awaitDocument($document->getId());
if ($document->getPageRenderingStatus() !== ProcessingStatus::POSITIVE) {
    $documentId = $document->getId();
    throw new \RuntimeException("Document $documentId is failed to render.");
}

$floors = [];

foreach ($document->getDocumentPages() as $page) {
    $page = $client->awaitDocumentPage($page->getId());
    if ($page->getPlanDetectionStatus() !== ProcessingStatus::POSITIVE) {
        continue; // Ignore pages without plans.
    }

    foreach ($page->getPlans() as $plan) {
        // Use progress as desired.
        // $plan->getHorizontalScaleProcessingStatus();
        // $plan->getWallProcessingStatus();
        // $plan->getRoomProcessingStatus();
        // $plan->getWallOpeningProcessingStatus();
        // $plan->getPostProcessingStatus();

        // Or wait for the plan to be processed.
        $plan = $client->awaitPlan($plan->getId());

        $floor =  $client->floorsApi->fetchFloor($plan->getFloorId());
        $floors[] = $floor;
    }
}

foreach ($floors as $floor) {
    $elements = $client->fetchFloorElements($floor->getId());
    // Do something with $elements['rooms'], $elements['walls'], $elements['openings'], $elements['scaleLines']]
}

Documentation

Please find detailed documentations in the following places:

  1. PHP Client Documentation
  2. API Endpoints Documentation
  3. Data Model Documentation

Further Links