PHP code example of sb15 / vk-api-client

1. Go to this page and download the library: Download sb15/vk-api-client 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/ */

    

sb15 / vk-api-client example snippets


$accessToken = '';
$publicId = '';
$vk = new \Sb\ApiClient\Vk(['access_token' => $accessToken]);
$vk->getMethodWallPost()
    ->setPublicId($publicId)
    ->setMessage('message')
    ->addTag('tag')  
    ->addAttachmentPhoto(realpath('/tmp/1.jpg'))
    ->addAttachmentLink('http://link.com')
    ->call();