PHP code example of newman / draugiem-php-sdk

1. Go to this page and download the library: Download newman/draugiem-php-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/ */

    

newman / draugiem-php-sdk example snippets


$draugiemApi = new \Newman\DraugiemPhpSdk\DraugiemApi(1234, 'app key');
//$draugiemApi = new \Newman\DraugiemPhpSdk\DraugiemApi(1234, 'app key', 'user key');

$response = $draugiemApi->apiCall('authorize', ['code' => 5728195]);

var_dump($response->getStatusCode());
var_dump($response->getBody()->getContents());

$draugiemApi = new \Newman\DraugiemPhpSdk\DraugiemApi(1234, 'app key');
$draugiemApi->setDefaultGuzzleClientOptions([
    'timeout' => 10,
    'headers' => [
        'User-Agent' => 'testing/1.0',
    ],
]);

// make an api call
bash
composer