Answer the question
In order to leave comments, you need to log in
What is the reason for getting error from VK API "Access denied"?
I can’t understand what is the reason, I use this code to get data about the group:
$request_params = array(
'group_id' => $id,
'access_token' => env('VK_ACCESS_TOKEN'),
'v' => '5.92'
);
$get_params = http_build_query($request_params);
$result = json_decode(file_get_contents('https://api.vk.com/method/groups.getById?'. $get_params), true);
$request_params = array(
'group_id' => $id,
'count' => 0,
'access_token' => env('VK_ACCESS_TOKEN'),
'v' => '5.92'
);
$get_params = http_build_query($request_params);
$result = json_decode(file_get_contents('https://api.vk.com/method/groups.getMembers?'. $get_params), true);
Answer the question
In order to leave comments, you need to log in
I don’t know what’s the matter, but in order to get VK group subscribers via API, you need to use not the group key and not the Standalone application key (I have several IP addresses, so the option didn’t work), but use the Standalone application service key. Only in this case I got a list of subscribers.
1. count - the number of community members, information about which you need to get.
positive number, default 1000, maximum value 1000.
Are you sure that setting 0 will remove the limit?
2. At the time of the second request, print $id and env('VK_ACCESS_TOKEN'), do they match?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question