PHP code example of eslavondigital / vk-bot-api

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

    

eslavondigital / vk-bot-api example snippets



Eslavon\VkBotApi\VkBotApi;

$http_client = new GuzzleHttp\Client();
$access_token = 'b519e3d2ee8a0b30436a39817186c7907561e8ad37cc15b55cb452c47e9901c617';
$version_api = "5.103";
$language = "ru";
$vk = new VkBotApi($http_client, $access_token, $version_api, $language);
$result = $vk->users()->get("251510315");
var_dump($result);

/**
 * { "response":
 *  [{
 *      "id":251510315,
 *      "first_name":"Виктор",
 *      "last_name":"Виноградов",
 *      "is_closed":false,
 *      "can_access_closed":true,
 *      "sex":2
 *  }]
 * }
 *  
 */