B
B
blabs2015-11-26 13:07:13
PHP
blabs, 2015-11-26 13:07:13

How to get his email when authorizing a user on the site through VK?

It is not possible to pull out the user's email via API. Tried different options, need help. We looked at how it works with colleagues, they form an email like [email protected] Where will the letters go in this case? In general, I need help in obtaining soap.
$args = array(
'method' => 'POST',
'body' => array(
'grant_type' => 'refresh_token',
'code' => $_REQUEST['code'],
'redirect_uri' => $redirect_uri ,
'client_id' => $this->vk_client_id,
'refresh_token' => $_COOKIE['refresh_token'],
'scope' => 'email'
)
);
$remote_post = wp_remote_post( $this->vk_exchange_url, $args );
wp_remote_post - WordPress function that makes a post request
This is how the query string for getting data looks like:
$userinfor = wp_remote_get( $this->vk_token_info_url.'?fields=photo_200,city,activities,email&access_token='.$data->access_token );
wp_remote_get is the wordpress function that the get request does

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
JhaoDa, 2015-11-26
@theblabs

We go to the documentation and look for permission email.

D
Dmitry Pavlov, 2015-11-26
@dmitry_pavlov

What was discussed here How to get an email via the VKontakte API? - doesn't work anymore?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question