Skip to content

SooMedia/floorplanner-v2

Repository files navigation

Build Status

Floorplanner v2

PHP client for the Floorplanner API v2.

Requirements

The API client requires PHP version 8.1.

Installation

Use Composer to install this package:

composer require soomedia/floorplanner-v2

Usage

The client is a simple wrapper for the Floorplanner API and you can use is as you would the API:

require 'vendor/autoload.php';

$client = new \SooMedia\Floorplanner\FloorplannerClient('your_api_key');

$response = $client->projects()->create([
    'project' => [
        'name' => 'My new house',
        'description' => 'This is my first floor plan',
        'external_identifier' => 'ID3344',
        'project_template_attributes' => [
            'template_id' => 10,
        ],
    ],
]);

/*
[
    'id' => 170280,
    'user_id' => 103,
    'public' => false,
    'name' => 'My new house',
    'description' => 'This is my first floor plan',
    'project_url' => '2fv03b',
    'created_at' => '2017-03-23T15:48:19.000Z',
    'updated_at' => '2017-03-23T15:48:19.000Z',
    'enable_autosave' => false,
    'external_identifier' => 'ID3344',
    'exported_at' => null,
]
*/

If you want to change the base URI used, you can supply that as the second argument for the client's constructor:

$client = new \SooMedia\Floorplanner\FloorplannerClient(
    'your_api_key',
    'https://sandbox.floorplanner.com/'
);

Implemented endpoints

Below is an overview of the implementation of the API endpoints and from which version the implementation is available.

Endpoint Implemented Version
Users Yes v0.0.3
Projects Yes v0.0.1
Project Permissions Yes v0.0.4
Media No
Designs No
Floors No
Drawings No
Cameras No
RoomTypeSets No
RoomTypes No
Templates No