Log in to URL:
https://oauth.vk.com/authorize?client_id=(СКРЫТО)&display=popup&redirect_uri=http://w-0rld.ru/index.php&response_type=code I get a token:
if (isset($_GET['code'])) { $token = file_get_contents("https://oauth.vk.com/access_token?client_id=(СКРЫТО)&client_secret=(СКРЫТО)&redirect_uri=http://w-0rld.ru/index.php&code=".$_GET['code']); $token_GET = json_decode($token); $token = $token_GET->access_token; $id = $token_GET->user_id; setcookie("token",$token,time()+3600); // Ставим куку на час ибо через час код будет не рабочим. setcookie("id",$id,time()+3600); header("Location: /"); } So far, everything is smooth, but as I begin to receive audio:
if($_GET['json'] AND $_GET['mode'] == 'audios') { header('Content-Type: application/json'); $list = file_get_contents('https://api.vk.com/method/audio.get?owner_id='.$_COOKIE['id'].'&count=81&access_token='.$_COOKIE['token']); exit ($list); } There is an error:
{"error":{"error_code":15,"error_msg":"Access denied: no access to call this method","request_params":[{"key":"oauth","value":"1"},{"key":"method","value":"audio.get"},{"key":"owner_id","value":"171166379"},{"key":"count","value":"81"}]}}