Answer the question
In order to leave comments, you need to log in
Need help with python code, wk_api. What could be the problem?
import requests
token = ''
data = requests.get(' https://api.vk.com/method/messages.getLongPollServer ',
params={'access_token': token}).json()['response']
print (data)
Error in KeyError: 'response', what could be?
Maybe I didn't specify something?
Answer the question
In order to leave comments, you need to log in
You have not specified all the parameters. Because of this, VKontakte does not return a response, but returns an error.
To see the error and what exactly is missing, use
data = requests.get('https://api.vk.com/method/messages.getLongPollServer',
params={'access_token': token}).json()
print(data)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question