API

api is a special automatically routed url.
back > sys > api

1. This sets /api as an automated api layer interacting with your application
2. It can request a class and method, and returns JSON objects.

Examples

Name Description
http://yourwebsite.com /api/{class}/{method} GET request to a class->method returning JSON objects
http://yourwebsite.com /api/{class}/{method}?pretty=1 GET request to a class->method returning JSON objects in pretty print.
http://yourwebsite.com /api/{class}/{method}?post=1 POST request to a class->method

Example

back > app > modelExample.php

            
class modelExample {
	public function getArray(){
	   return [1,2,3,4];
	}
}
            
        

http://website.com/ api/modelExample/getArray

            
//prints out returned object from $app->example->get_array in JSON format
[1,2,3,4]