PHPackages                             innovatif/restfulserver-extension - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. innovatif/restfulserver-extension

ActiveSilverstripe-vendormodule[API Development](/categories/api)

innovatif/restfulserver-extension
=================================

Extension for RestfulServer; adds APIID and fluent capatibilities

00PHPCI passing

Since Apr 23Pushed 3mo agoCompare

[ Source](https://github.com/Innovatif/restfulserver-extension)[ Packagist](https://packagist.org/packages/innovatif/restfulserver-extension)[ RSS](/packages/innovatif-restfulserver-extension/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Restful Server Extension module
===============================

[](#restful-server-extension-module)

This module handles APIID (a UUID for each DataObject) and i18n support for REST calls in SilverStripe.

configuration with APIId...
---------------------------

[](#configuration-with-apiid)

To add an APIID, i18n support for REST calls and support for remote file handling via URLs, you need to add the following configuration to your YAML config file:

```
My\Namspace\Model\MyAPIClass:
  extensions:
    apiid: Innovatif\RestfulServerExtension\Extension\ApiId
    synclock: Innovatif\RestfulServerExtension\Extension\SyncLock # allows to lock objects for API sync
    autopublish: Innovatif\RestfulServerExtension\Extension\AutoPublish # automatically publishes objects after API sync
    fluentapi: Innovatif\RestfulServerExtension\Extension\FluentAPIUpdate #for handling translations; needs fluent applied on the DataObject
    filehandling: Innovatif\RestfulServerExtension\Extension\RemoteFileHandling #for handling files with URLs
    autopublish: Innovatif\RestfulServerExtension\Extension\AutoPublish #for automatically publishing new items
    generateurlsegment: Innovatif\RestfulServerExtension\Extension\GenerateURLSegment #for generating the urlsegement in translations; schema is -
```

Note: FluentAPIUpdate extension also needs fluent and throws an exception, if the class doesn't have fluent applied.

checking required extensions on dev/build
-----------------------------------------

[](#checking-required-extensions-on-devbuild)

On `dev/build`, the module will check if the required extensions are installed. If not, it will throw an error message.

The required extensions can be configured with the `Innovatif\RestfulServerExtension\Extension\DevBuild.required_extensions` config variable.

Requirements
------------

[](#requirements)

This module requires a specific branch of `silverstripe/restfulserver` (version 3.1) which includes necessary hooks and cleanup. See [silverstripe/restfulserver issue #144](https://github.com/silverstripe/silverstripe-restfulserver/issues/144) for details.

To use this in your project, add the following to your `composer.json`:

```
{
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/wernerkrauss/silverstripe-restfulserver.git"
        }
    ],
    "require": {
        "silverstripe/restfulserver": "dev-144-cleanup-hooks as 3.1"
    }
}
```

Handling Translations in REST calls
-----------------------------------

[](#handling-translations-in-rest-calls)

TBD

Remote File Handling
--------------------

[](#remote-file-handling)

To handle remote files via URLs, you can use the `RemoteFileHandling` extension. It will automatically download the file from the provided URL, check its hash, and save it to the DataObject.

Unfortunately, there is some manual work required to set the file relation on the DataObject.

### The file relation must not have the same name as the File or DataObject relation.

[](#the-file-relation-must-not-have-the-same-name-as-the-file-or-dataobject-relation)

We need some helper methods in the DataObject to handle remote file handling. The relation name must not be the same as the File or DataObject relation name, otherwise it will not work.

### Remote File Handling

[](#remote-file-handling-1)

The `RemoteFileHandling` extension can be configured to process remote files via a queue instead of direct processing. This is configured on the **owner class** that uses the extension.

```
# Example: Enable queue for the Event page
My\Namespce\Page\Event:
  use_queue: true
```

When enabled, remote files will be enqueued using `QueuedJobService` (if available). By default, this is set to `false`.

You can configure the root folder for REST uploads by adding the following to your YAML configuration:

```
SilverStripe\Security\Member:
  rest_upload_folder: 'your-custom-folder/'
```

The default is `ru/`.

By default an upload folder for each member is created in that configured folder. If you want to disable this for specific members, add a method `public function updateCanCreateRESTFolder(): bool` to your Member object.

### Example for a DataObject with remote file handling

[](#example-for-a-dataobject-with-remote-file-handling)

```
class Event extends DataObject
{
    private static string $table_name = 'Event';

    private static array $db = [
        'Title' => 'Varchar',
        'Description' => 'Text'
        // other fields
    ];

    private static array $has_many = [
        'EventImages' => Image::class,
    ];

    private static array $owns = [
        'EventImages' => Image::class,
    ];

    private static array $extensions = [
        RemoteFileHandling::class,
    ];

    private static array $api_fields = [
        'Title',
        'Description',
        'Images', // this will call the getImages() method
    ];

    /**
     * Returns the file URLs for the Images relation.
     * This method uses the RemoteFileHandling extension to get the file URLs as a json array, e.g.
     * ["https://example.com/image1.jpg", "https://example.com/image2.jpg"]
     *
     * Can be called via API as `Images` field.
     *
     * @return string
     */
    public function getImages(): string
    {
        return $this->getFileUrls($this->EventImages());
    }

}
```

###  Health Score

18

—

LowBetter than 7% of packages

Maintenance55

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/97c7c3c6195eea35946a6a79a920828e6a6d6590979daf7809252f0a521ff7a2?d=identicon)[tomaszpirc](/maintainers/tomaszpirc)

---

Top Contributors

[![wernerkrauss](https://avatars.githubusercontent.com/u/1043925?v=4)](https://github.com/wernerkrauss "wernerkrauss (46 commits)")

### Embed Badge

![Health badge](/badges/innovatif-restfulserver-extension/health.svg)

```
[![Health](https://phpackages.com/badges/innovatif-restfulserver-extension/health.svg)](https://phpackages.com/packages/innovatif-restfulserver-extension)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k18](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
