我正在使用以下 php 代码:
$vk = new VK($app_id, $api_secret);
$user_wall = $vk->api('newsfeed.get', array(
//'owner_id' => $o->profile_uid,
'count' => 100,
'filters' => 'post,photo,wall_photo,friend',
'access_token' => $o->profile_token
));
echo '<pre>';
print_r($user_wall);
exit;
尝试上述代码时出现错误。我已成功完成身份验证并将用户配置文件信息存储在 mysql 表中。我注意到当我在 App> Setting 中看到 Api.Console 权限时,我看到了 Access the Wall 权限。但是在我用来检索数据的应用程序中,我没有看到这个权限。
错误描述:执行此操作的权限被拒绝
错误代码:7
文档描述得很差。即使哪个字段是必需的或可选的,我也无法确定。带有过滤器“其他”的 wall.get 与 newsfeed.get 有什么区别?
登录代码:
$AuthURL = $vk->getAuthorizeURL('notify,friends,photos,audio,video,docs,notes,pages,status,offers,questions,wall,groups,notifications,stats,ads,offline', $redirect_uri);
授权码:
$vk_code = $_REQUEST['code'];
$vk = new VK($app_id, $app_secret);
$access_token = $vk->getAccessToken($vk_code, $redirect_uri);
$uid = $access_token['user_id'];
$token = $access_token['access_token'];
$user_info = $vk->api('users.get', array(
'user_ids' => $uid,
'fields' => 'nickname, screen_name, sex, bdate (birthdate), city, country, timezone, photo, photo_medium, photo_big, has_mobile, contacts, education, online, counters, relation, last_seen, activity, can_write_private_message, can_see_all_posts, can_post, universities, counters'
));