Making Chat Bot Vkontakte in Python. I recently wanted to add one function to the bot, but for this feature you need to have an Access_Token of a user who sent a message. There is an option to ask the user to follow the link (type This is such a ) and ask you to send the resulting token. But it is very long and limited.
What is the actual question: Is it possible to make sure that the user goes on the link, pressed “resolve”, and then the token automatically sent me? If such an opportunity is, please write as it can be done on Python.
p.s. I have a working server on Flask, because Bot on Callback API.
Answer 1, Authority 100%
The link for authorization as a redirect address you need to specify the address of your server (for example redirect_uri = http: //my_server.ru/callback
), after authorization of the user at this address will receive a get-request indicating this address User tokens of this type:
http: //my_server.ru/callback? code = 7a6fa4dff77a228eeda56603b8f ...
On the server side you will need this request to process.
Documentation: Authorization Code Flow To get the user’s access key