PHP code example of kuga / openapi-sdk

1. Go to this page and download the library: Download kuga/openapi-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kuga / openapi-sdk example snippets


$requestObject = new Request($_POST);
$requestObject->setOrigRequest($_POST);
ApiService::setDi($this->getDI());
ApiService::initApiJsonConfigFile('路径/api.json');
$result = ApiService::response($requestObject);
echo json_encode($result);