Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.
/ vk-php-api-client Public archive

VKontakte API PHP Client

License

Notifications You must be signed in to change notification settings

mdimaas/vk-php-api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dependency Status

VKontakte API Client for PHP

##Installation

If you're usage Composer, which we recommend, add record in your composer.json file

{
  "require":{
    ...
    "deliciousdishes/vk-api-client": "dev-master"
    ...
  },
  "repositories":[
        ...
        {
            "type": "git",
            "url": "https://github.com/mdimaas/vk-php-api-client"
        }
        ...
  ]
  
}

##Example usage

For get URL by authorization in VK

$helper = new \DeliciousDishes\VKLoginHelper("http://yoursite.com", "your_app_id", "your_app_secret", array("email", ...,"offline"));
$url = $helper->getLoginUrl();

After click by link VK redirected in back with secure code in GET parameter. Now get VK session by secure code. Example:

$helper = new \DeliciousDishes\VKLoginHelper("http://yoursite.com", "your_app_id", "your_app_secret", array("email", ...,"offline"));
$helper->getSession(); 
// or if your secure code saved in var
// $helper->getSession($secureCode); 

Session stores current user id $session->getUserId() For send request in VK API. Example get user information by ids:

$request = new \DeliciousDishes\VKRequest($session, "users.get", array("user_ids" => $session->getUserId(),"fields" => "email,..."));
$response = $request->execute()->getResponseData();

Result query: mixed the value encoded in json in appropriate PHP type.

About

VKontakte API PHP Client

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages