EXT: Restler 

Classification

Documentation

Version

0.1

Language

en

Description

This is a TYPO3 Extension, which integrates the Luracast Restler Web API Framework (PHP REST-framework to create REST-API's, https://github.com/Luracast/Restler) in TYPO3.

This extension is based on Luracast Restler Version 3.0.

Keywords

restler,REST,API,RESTful

Copyright

2015

Author

AOE GmbH

Email

dev@aoe.com

License

Copyright 2015 AOE GmbH

All rights reserved

This Extension is part of the TYPO3 project. The TYPO3 project is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html.

This Extension is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Luracast Restler Version 3.0. is distributed under GNU LESSER GENERAL PUBLIC LICENSE Version 2.1 (see /vendor/luracast/restler/LICENSE) and is included for your convenience in the vendor folder.

Rendered

Tue, 31 Mar 2026 08:05:35 +0000

The content of this document is related to TYPO3, a GNU/GPL CMS/Framework available from www.typo3.org.

Table of Contents

What does it do? 

The target audience is developers looking to expose an REST API from their respective extensions.

This extension gives the possibility of using Luracast Restler in TYPO3. It provides the basis for using REST in your own extensions acting like a wrapper.

Contribute back! 

If you find any mistakes in the documentation or our code, we would be honoured if you could submit an issue or a pull request on Github in order to correct it.

Developer Manual 

Describes how to manage the extension from a developer’s point of view.

Target group: Developers

Installation 

  1. Install the extension from TER or from our GitHub repository.
  2. Configure this TYPO3-Extension (in TYPO3 Extension-Manager; e.g. enable the online documentation of your REST-API). See the "Screenshots" section as well.
  3. (Optional, but recommended) Install the TYPO3 Extension "TYPO3 Restler Examples".
  4. Make the .htaccess changes described below:

The ".htaccess" file needs to be changed in order to make the REST API available.

# Allow access to example.com/api for normal REST calls
RewriteRule ^api/(.*)$ typo3conf/ext/restler/Scripts/restler_dispatch.php [NC,QSA,L]

# Allow access to example.com/api_explorer for the online documentation of your API.
# You may want to restrict access to this URL.
RewriteRule ^api_explorer/(.*)$ typo3conf/ext/restler/Scripts/restler_dispatch.php [NC,QSA,L]
Copied!

When this is done, than you can call the online documentation of your REST API via this URL:

You also can call your REST API via this URL:

Using TYPO3 Restler in our own extension (aka Writing your own REST API) 

In order to offer a seamless integration of Restler in TYPO3, this extension offers the interface "AoeRestlerSystemRestlerConfigurationInterface".

With classes implementing the "ConfigurationInterface", it is possible to configure Restler:

  • Restler configuration can be defined (eg. supported response format)
  • API endpoints can be defined
  • Authentication classes can be defined (to protect API endpoints against unauthorized access)

Steps:

  1. Create new PHP-class, which implements this Interface:
Aoe\Restler\System\Restler\ConfigurationInterface
Copied!

You can use this PHP-class as example

Aoe\RestlerExamples\System\Restler\Configuration
Copied!

Inside your PHP-class, you can configure the Restler framework:

  • add API classes to the Restler object
  • add Authentication classes to Restler object
  • configure all static properties of PHP classes, which belong to the Restler framework
  1. Register your PHP-class in your TYPO3-Extension (in ext_localconf.php-File)

Any class that implements the "AoeRestlerSystemRestlerConfigurationInterface" interface, must be declared in your extension "ext_localconf.php" file.

// Add the configuration class (in Extension 'restler'):
// In that configuration class, we can:
// - configure the cache directory
// - enable the extbase DI container
// - enable the online API documentation (if enabled in extension-configuration)
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['restler']['restlerConfigurationClasses'][] = 'Aoe\\Restler\\System\\RestlerConfiguration';
Copied!

This way the following will be achieved:

  • each extension can define any number of Restler configuration classes.
  • the Restler configuration classes will only be called when an API endpoint is called (has no side-effects on normal calls of TYPO3).
  1. Flush the TYPO3 System Cache

The API call sequence briefly explained 

@TODO

Screenshots 

Extension configuration:

API Explorer:

The AOE Way 

AOE ( www.aoe.com ) is a leading provider of Enterprise Open Source web solutions.
Using current agile development methods, more than 180 developers and consultants in 8 global locations
develop customized Open Source solutions for global Fortune 500 companies and corporations.

For more than 15 years we have been designing and developing complex Enterprise Web Content Management
Systems, E-Commerce and Mobile Applications as well as Web Portal solutions based on Open Source
technology and successfully launched over 1,400 projects worldwide.

The integration of Open Source software is a central element of our
corporate philosophy and key driver of our growth.

The sourcecode of this Extension is continuously monitored by a Jenkins job.