Answer the question
In order to leave comments, you need to log in
vk api. Why doesn't it return all fields?
There is a users.getSubscriptions method that displays which communities the user is a member of.
If you test in the developer section, then VK gives this
response: {
count: 76,
items: [{
id: 57876954,
name: 'Vine Video',
screen_name: 'vinevinevine',
is_closed: 0,
type: 'page',
is_admin: 0,
is_member: 1,
photo_50: 'http://cs425327.v...6bb/Zu_yFZL4dXg.jpg',
photo_100: 'http://cs425327.v...6ba/ttuRoe42pnE.jpg',
photo_200: 'http://cs425327.v...6b9/8M2hy2j1vOA.jpg'
}, {
id: 7177686, .......
public function getGroupUser($id_user){
$method='https://api.vk.com/method/users.getSubscriptions?';
$data=[
'count'=>20,
'user_id'=>$id_user,
'extended'=>1,
'fields'=>'is_admin,is_member'
];
return json_decode(file_get_contents($method.urldecode(http_build_query($data))),true);
}
Answer the question
In order to leave comments, you need to log in
All decided. Need access_token + pass admin in the filter parameter
public function getGroupUser($id_user,$token){
$method='https://api.vk.com/method/groups.get?';
$data=[
'count'=>200,
'user_id'=>$id_user,
'extended'=>1,
'filter'=>'admin',
'access_token'=>$token,
];
return json_decode(file_get_contents($method.urldecode(http_build_query($data))),true);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question