1. Go to this page and download the library: Download dapi-co/dapi-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/ */
dapi-co / dapi-php example snippets
// Assuming that Dapi library is already autoloaded. If not, manually include/
// Assuming that Dapi library is already autoloaded. If not, manually include/harset=UTF-8");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Max-Age: 3600");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
// Initialize DapiClient with your appSecret here
$dapiClient = new Dapi\DapiClient('APP_SECRET');
$headers = getallheaders();
$body = json_decode(file_get_contents("php://input"), true);
// Make dapiClient automatically handle your SDK requests
if (!empty($body)) {
echo json_encode($dapiClient->handleSDKRequests($body, $headers));
} else {
http_response_code(400);
echo "Bad Request: No data sent or wrong request";
}
function exchangeToken($accessCode, $connectionID)
function getIdentity($accessToken, $userSecret, $userInputs = [], $operationID = "")
function getAccounts($accessToken, $userSecret, $userInputs = [], $operationID = "")
function getBalance($accessToken, $userSecret, $accountID, $userInputs = [], $operationID = "")