Answer the question
In order to leave comments, you need to log in
How to send a GET request?
There was such a problem. I want to send a message using a get request. I am using the requests library. With methods that do not require access rights, everything works out fine. But when access rights are needed, nothing happens. I write scope=messages, but...
r = requests.get('https://api.vk.com/method/messages.send?user_id=1111&message=hello&scope=offline,messages&v=5.52&access_token=my_token')
{"error":{"error_code":15,"error_msg":"Access denied: no access to call this method","request_params":[{"key":"oauth","value":"1"},{"key":"method","value":"messages.send"},{"key":"user_id","value":"160400462"},{"key":"message","value":"hello"},{"key":"scope","value":"offline,messages"},{"key":"v","value":"5.52"},{"key":"expires_in","value":"86400"}]}}
Answer the question
In order to leave comments, you need to log in
scope needs to be written at the stage of obtaining a token, and not when sending a message. And the GET request itself goes fine.
By the way, there is a ready-made library for requests to VK: https://pypi.python.org/pypi/vk
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question