what's the matter returns an error

{"error":{"error_code":5,"error_msg":"User authorization failed: access_token was given to another ip address.","request_params":[{"key":"oauth","value":"1"},{"key":"method","value":"messages.send"},{"key":"domain","value":"user"},{"key":"v","value":"5.37"}]}} 

send function

 $url = 'https://api.vk.com/method/messages.send'; $params = array( 'domain' => 'maksim_drosdow', // Кому отправляем 'message' => $request->message, // Что отправляем 'access_token' => 'e42c016e16154291a4859055ba54375f', // access_token можно вбить хардкодом, если работа будет идти из под одного юзера 'v' => '5.37', ); // В $result вернется id отправленного сообщения $result = file_get_contents($url, false, stream_context_create(array( 'http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query($params) ) ))); return $result; 
  • one
    everything is already written in your error message that the given access_token was issued for another ip address. - Insider
  • and how can this be, if I tied to the site - Ssasha
  • You need to request a token through the site itself and enter it. As I understand it, you requested it manually through your ip, not the ip of the site. - Insider
  • and through the site just return like this? return redirect ('https: / / oauth.vk.com/ authorize? client_id = 123123 & display = page & redirect_uri = https: // oauth.vk.com /blank.html&scope=offline,messages&response_type=token&v=5.37') or otherwise as? - Ssasha

0