Answer the question
In order to leave comments, you need to log in
How to get a list of audio recordings from a VKontakte group using Open API?
How to get a list of audio recordings from a given open VKontakte group using the Open API ?
From incomprehensible moments, in particular, - VK.Auth.getLoginStatus returns status = 'connected' only if the user is authorized and granted rights to the application? Or if authorized, but did not give the right, then too? If so, how to check the rights and request them?
Tried using the following code -
<button type="button" onclick="VK.Auth.login(vk_auth, 8);">
<script src="http://vk.com/js/api/openapi.js" type="text/javascript"></script>
<script type="text/javascript">
function vk_auth(response) {
console.log('response: '+response);
if (response.session) {
console.log('VK user authenticated');
console.log(response);
if (response.status === 'connected') {
var uid = response.session.mid;
var sid = response.session.sid;
console.log('uid: '+uid+', sid: '+sid);
VK.Api.call('audio.get', {owner_id: '-8398xxxx', need_user: '0', count: '6000'}, function(r) {
console.log(r);
if (r.response) {
//
}
});
}
} else {
console.log('VK user failed to authenticate');
}
}
VK.init({
apiId: 1234567
});
VK.Auth.getLoginStatus(vk_auth);
</script>
Answer the question
In order to leave comments, you need to log in
https://vk.com/dev/account.getAppPermissions
if(response & 8) {
alert('нужен доступ к аудио');
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question