PHPackages                             symbiote/silverstripe-apiwrapper - 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. symbiote/silverstripe-apiwrapper

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

symbiote/silverstripe-apiwrapper
================================

Provides an API wrapper around service style classes

1.6.0(4y ago)24.5k23BSD-3-ClausePHPCI failing

Since May 24Pushed 4y ago1 watchersCompare

[ Source](https://github.com/nyeholt/silverstripe-apiwrapper)[ Packagist](https://packagist.org/packages/symbiote/silverstripe-apiwrapper)[ RSS](/packages/symbiote-silverstripe-apiwrapper/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (3)Versions (12)Used By (3)

SilverStripe API Wrapper
========================

[](#silverstripe-api-wrapper)

[![Latest Stable Version](https://camo.githubusercontent.com/2235d5a658d37702f31db56c72a7c6a72601025d585edfc3e466120ee4b9a7d4/68747470733a2f2f706f7365722e707567782e6f72672f73796d62696f74652f73696c7665727374726970652d617069777261707065722f76657273696f6e2e737667)](https://github.com/symbiote/silverstripe-apiwrapper/releases)[![Latest Unstable Version](https://camo.githubusercontent.com/4fc9fec0e6d808772681c9151a19a60845f6553e8cb6dbc18af9bcb872206970/68747470733a2f2f706f7365722e707567782e6f72672f73796d62696f74652f73696c7665727374726970652d617069777261707065722f762f756e737461626c652e737667)](https://packagist.org/packages/symbiote/silverstripe-apiwrapper)[![Total Downloads](https://camo.githubusercontent.com/1f7b1ade4cb94f3b5b2d8eb5f388862f32f2a399cd8e592294f02ba3533af657/68747470733a2f2f706f7365722e707567782e6f72672f73796d62696f74652f73696c7665727374726970652d617069777261707065722f646f776e6c6f6164732e737667)](https://packagist.org/packages/symbiote/silverstripe-apiwrapper)[![License](https://camo.githubusercontent.com/9aa103372acf900bc703174094780fd99be4eff777cc74d935c3c19acf8d2c4e/68747470733a2f2f706f7365722e707567782e6f72672f73796d62696f74652f73696c7665727374726970652d617069777261707065722f6c6963656e73652e737667)](https://github.com/symbiote/silverstripe-apiwrapper/blob/master/LICENSE.md)

Wrap your service APIs in a web layer

Composer Install
----------------

[](#composer-install)

```
composer require symbiote/silverstripe-apiwrapper:~1.0

```

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

[](#requirements)

- SilverStripe 4.1+

Documentation
-------------

[](#documentation)

**Quick start**

Suppose we have a class `Symbiote\Watch\WatchService` that we want to expose to web requests via /api/v1/watch/{methodname}

First, implement `webEnabledMethods`, returning an array of methods mapping to the request types that can trigger them, ie

```
    public function webEnabledMethods()
    {
        return [
            'store' => 'POST',
            'list' => 'GET',
        ];
    }

```

In config;

```
---
Name: my_webservices
---
Symbiote\ApiWrapper\ApiWrapperController:
  versions:
    v1:
      watch: 'WatchServiceApiController' # The name of an injector service

SilverStripe\Core\Injector\Injector:
  WatchServiceApiController: # Referenced by above
    class: Symbiote\ApiWrapper\ServiceWrapperController
    properties:
      service: %$Symbiote\Watch\WatchService

```

Additional Options
------------------

[](#additional-options)

The return of webEnabledMethods can provide additional information, such as

```

return [
  'list' => [
    'type' => 'GET',
    'call' => 'myMethod', // the name of a method on the service to execute
    'public' => true,
    'match' => 'regex; see below',
    'perm' => 'CMS_Access_etc'
  ]
]

```

**match**

You can define a regex in the 'match' key which allows you to match parameters from the URL substring that is left after the api and method paths are removed.

Note that you *must* define regex using named capture groups.

For example

`'match' => '(?\d+)'`

and the URL

`/api/v1/list/12`

will call the 'list' method with the `$parent` parameter set to 12.

Note that this must be the *full* URL match, meaning you should have a capture group for all parts of the URL. In other words, the 'match' string is wrapped in `"{^" . $match . "$}"` for the regex that actually gets executed.

Token-based authentcation
-------------------------

[](#token-based-authentcation)

Add the user token extension for users and then add the token authenticator middleware

```

SilverStripe\Security\Member:
  extensions:
    - Symbiote\ApiWrapper\TokenAccessible

SilverStripe\Core\Injector\Injector:
  SilverStripe\Security\AuthenticationHandler:
    properties:
      Handlers:
        token: '%$Symbiote\ApiWrapper\TokenAuthHandler'

```

- [License](LICENSE.md)
- [Contributing](CONTRIBUTING.md)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~87 days

Recently: every ~145 days

Total

10

Last Release

1758d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/25cb1c56a7ab949d1e6b28a2a04862ce1cffe1799a291e1797f8dfd33cd83716?d=identicon)[nyeholt](/maintainers/nyeholt)

---

Top Contributors

[![nyeholt](https://avatars.githubusercontent.com/u/161730?v=4)](https://github.com/nyeholt "nyeholt (19 commits)")

---

Tags

silverstripesymbiotewebservers

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/symbiote-silverstripe-apiwrapper/health.svg)

```
[![Health](https://phpackages.com/badges/symbiote-silverstripe-apiwrapper/health.svg)](https://phpackages.com/packages/symbiote-silverstripe-apiwrapper)
```

PHPackages © 2026

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