PHP code example of ferrumfist / vipip_sdk

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

    

ferrumfist / vipip_sdk example snippets


VipIP::init(<access_token>[, $config]);

[
'lang'=>'ru',
'cache' => [
    'driver' => 'redis',
    'config' => [
        'host' => '127.0.0.1',
        'port' => '6379'
    ]
]

$user = VipIP::module('user');

$user->getBalance();

$user->getDiscount();

$link = VipIP::module('link')->create("My first link", "http://example.com");

$links = VipIP::module('link')->getList([43,648,474]);
$link = VipIP::module('link')->getOne(45);

$link->save([
	'title' => 'new titile',
	'url' => 'http://new_url.org'
]);

if( !$link->changeBalance(3, \Vipip\Service\Service::BALANCE_TYPE_DAYS) ){
   echo $link->getLastError();
}