P
P
pitty132016-12-28 13:14:29
API
pitty13, 2016-12-28 13:14:29

Working with api PHP and can't get the data?

I work with api vkontakte from under php. Authorization works for me, then getting an access_token, and then I try to get data about the user's groups (where he is an admin).

$request_params = array(
            'user_id' => $user_id,
            'extended' => '0',
            'filter' => 'admin',
            'offset' => '0',
            'count' => '1000',
            'v' => '5.60'
        );

        $get_params = http_build_query($request_params);

        $curl = curl_init();
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
        curl_setopt($curl, CURLOPT_URL, 'https://api.vk.com/method/groups.get?' . $get_params . '&access_token=' . $access_token);
        $response = curl_exec($curl);
        curl_close($curl);
        $response1 = json_decode($response, true);

the answer comes
"{"error":{"error_code":5,"error_msg":"User authorization failed: method is unavailable with server auth.","request_params":[{"key":"oauth","value":"1"},{"key":"method","value":"groups.get"},{"key":"user_id","value":"52248258"},{"key":"extended","value":"0"},{"key":"filter","value":"admin"},{"key":"offset","value":"0"},{"key":"count","value":"1000"},{"key":"v","value":"5.60"}]}}"
array:1 [▼
  "error" => array:3 [▶]
]

what am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kmx, 2016-12-28
@kmx

User authorization failed: method is unavailable with server auth.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question