1. edit the configuration (mode details [here](#IV. configuration))
2. create the modules classes and implement their methods according to your configuration (mode details [here](#V. implementation))
#### 2. Internal use in php
You can use your api from php directly without using HTTP request.
First, you must require the `autoloader` file and load the API.
```php
<?php require_once '../autoloader.php'
use \api\core\Request;
use \api\core\Request;
```
Then, you must pass the module, the method and the parameters.
```php
<?php require_once '../autoloader.php'
use \api\core\Request;
use \api\core\Request;
$module = 'user'; // the module 'user'
$method = 'getUsername'; // and its method 'getUsername'
$params = ['id_user' => 'someusername']; // and the parameters
// 1. Create the request
$request = new Request("$module/$method", $params);
// 2. Execute request and catch response
$response = $request->dispatch();
// 3. Get response error code
$error_code = $response->error->get();
// 4. Get response output
$output = $response->getAll();
```
#### 3. HTTP Request use in php
In order to setup an automatic bound from HTTP requests to API directly, you must use a router. Then you have some possibilities :
**Case 1**: You want an URL like `http://www.host.com/{module}/{method}/` and pass parameters through POST or form-data. In order to set it up, you must catch the url starting at `/{module}/{method}` so you have to truncate the beginning (for instance if you have /api/{module}/..)
**Case 2**: You want an URL like `http://www.host.com/api/` and pass all data through POST or form-data.