1. Go to this page and download the library: Download s-patompong/hmrc-api-php 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/ */
s-patompong / hmrc-api-php example snippets
$request = new \HMRC\Hello\HelloWorldRequest;
// Response is instant of HMRCResponse class
$response = $request->fire();
return $response->getBody();
// ServerToken is singleton so please use getInstance() method to get an instance and then use set method on it
\HMRC\ServerToken\ServerToken::getInstance()->set($_GET['server_token']);
$request = new \HMRC\Hello\HelloApplicationRequest;
$response = $request->fire();
return $response->getBody();