Smalldb-REST  v0.2
Smalldb-REST

Simple implementation of REST API for Smalldb.

Requirements

Installation

  1. Use composer install to install all libraries.
  2. Create state machine definitions in statemachine directory – see libsmalldb documentation for details.

API Usage

Read state of a state machine (machine ID = "blogpost", 1):

1 HTTP GET /api-v1.php/blogpost/1

Read transition info of a state machine (transition edit):

1 HTTP GET /api-v1.php/blogpost/1!edit

Invoke transition of a state machine (transition edit, parameters are passed via `$_POST['args']`):

1 HTTP POST /api-v1.php/blogpost/1!edit
2 Content-Type: application/x-www-form-urlencoded
3 
4 args[0][title]=Some%20title&args[1][text]=Lorem%20ipsum

List state machines of given type:

1 HTTP GET /api-v1.php/?type=blogpost

LICENSE

Apache 2.0 - see LICENSE file