PHP Library Quickstart
Configure Project
- Add the library module to your project using composer. Add the following in your
composer.json
"require": {
"dapi-co/dapi-php": "^1.3",
},
OR simply type this in your project folder.
composer require dapi-co/dapi-php
- Create a DapiClient with your App Secret.
// Assuming that Dapi library is already autoloaded. If not, manually include/require it here.
$dapiClient = new Dapi\DapiClient('APP_SECRET');
- Now you can use any of the functions of the products available on the client (
data
for example) instance to call Dapi. Here is an example forgetAccounts
.
$accessToken = 'ACCESS_TOKEN';
$userSecret = 'USER_SECRET';
$accounts = $dapiClient->data->getAccounts($accessToken, $userSecret);
echo PHP_EOL . 'Accounts' . PHP_EOL . PHP_EOL;
echo (json_encode($accounts, JSON_PRETTY_PRINT));
Updated 12 months ago
What’s Next