M
M
Maxim Timofeev2016-11-08 17:36:41
JavaScript
Maxim Timofeev, 2016-11-08 17:36:41

How to get a user's email from VK?

I can't get the user's email. I get permission, but there is no email in data.session.user (code below). I try to get the data later, everything comes up except email

$("#vk-login").on('click',function(){
        VK.Auth.login(function (data) {
            console.log(data);
            if(data.status == 'connected'){
                VK.Api.call('users.get', {user_ids: data.session.user.id,fields: 'id,first_name,last_name,photo_200,email'}, function(r) {
                    console.log(r);
                });
/*                auth('vk',data.session.user);*/
            }
        },4194304);

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Sofronov, 2016-11-08
@maxsof

A VK user may not have soap if only a phone is attached. That's right, I found out in technical support. Try to explicitly authorize a user whose soap is exactly specified in the settings.

S
Sergey Goryachev, 2016-11-08
@webirus

How to get email via VKontakte API?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question