Answer the question
In order to leave comments, you need to log in
How to send a VK message from another user?
Hello.
People do not tell me how the users themselves can send messages on my site on their behalf to other VK users?
Those. there is a personal account on the site, where the account owner specifies his login and password, specifies the text of the message, indicates the user id to whom the message needs to be sent and clicks send, and the message is sent on his behalf to another person.
is it possible to do this?
Answer the question
In order to leave comments, you need to log in
Alas, this will be relatively difficult to do.
1. Create a Desktop/Standalone application
2. Then you need to authorize the user , get an access_token with messages rights. (scope=messages&response_type=token&display=mobile&redirect_uri= https://oauth.vk.com/blank.html )
After authorization, the token will be located in the user's address bar, namely in location.hash. But to get it without crutches will not work.
3. It is necessary to intercept everything that comes to the user from VK servers.
3.1 You can create a grabber that logs in to the mobile version of VK itself, and then receives a token.
3.2 Make something like an anonymizer. We catch the redirect to vk.com/blank.html#access_token=*** and save the received token
It is easier to write a grabber specifically for the mobile version.
4. Well, if you still managed to get a token - vk.com/dev/messages.send
Unfortunately, the VK developers have greatly limited the opportunities for web developers.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question