Download the PHP package colymba/silverstripe-restfulapi without Composer

On this page you can find all versions of the php package colymba/silverstripe-restfulapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silverstripe-restfulapi

:warning: I haven't been able to give as much love as I would like to these repos as they deserve. If you have time and are interested to help maintain them, give me a shout. :rotating_light:

SilverStripe RESTful API

Build Status

This module implements a RESTful API for read/write access to your SilverStripe Models. It comes bundled with a default Token Authenticator, Query Handler and JSON Serializers, and can be extended to your need and to return XML or other content type via custom components.

API URL structure

Action HTTP Verb URL
Find 1 record GET api/Model/ID
Find multiple records GET api/Model?param=val&__rand=1234
Update a record PUT api/Model/ID
Create a record POST api/Model
Delete a record DELETE api/Model/ID
- - -
Login & get token n/a api/auth/login?email=***&pwd=***
Logout n/a api/auth/logout
Password reset email n/a api/auth/lostPassword?email=***
- - -
Custom ACL methods n/a api/acl/YOURMETHOD

Model being the class name of the model you are querying (name formatting may vary depending on DeSerializer used). For example with a model class named Book URLs would look like:

The allowed /auth/$Action must be defined on the used Authenticator class via the $allowed_actions config.

Requirements

Quick features highlight

What's all this?

RESTfulAPI

This is the main API Controller that receives all the requests, checks if authentication is needed and passing control to the authenticator if true, the resquest is then passed on to the QueryHandler, which uses the DeSerializer to figure out model & column names and decode the eventual payload from the client, the query result is then passed to the Serializer to be formatted and then returned to the client.

If CORS are enabled (true by default), the right headers are taken care of too.

Components

The RESTfulAPI uses 4 types of components, each implementing a different interface:

Default components

This API comes with defaults for each of those components:

You can create you own classes by implementing the right interface or extending the existing components. When creating you own components, any error should be return as a RESTfulAPIError object to the RESTfulAPI.

Token Authentication Extension

When using TokenAuthenticator you must add the TokenAuthExtension DataExtension to a DataObject and setup TokenAuthenticator with the right config.

By default, API authentication is disabled.

Permissions management

DataObject API access control can be managed in 2 ways. Through the api_access DataObject permissions through a PermissionManager component.

A sample Group extension GroupExtension is also available with a basic set of dedicated API permissions. This can be enabled via config or you can create your own.

By default, the API only performs access control against the api_access YML config.

Config

See individual component configuration file for mode details

Here is what a site's config.yml file could look like:

Todo

License

BSD 3-clause license

Copyright (c) 2018, Thierry Francois (colymba) All rights reserved.


All versions of silverstripe-restfulapi with dependencies

PHP Build Version
Package Version
Requires silverstripe/framework Version ~4.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package colymba/silverstripe-restfulapi contains the following files

Loading the files please wait ...