Z
Z
ZIK13372020-12-23 13:35:49
API
ZIK1337, 2020-12-23 13:35:49

Why does it sometimes not return a token when requested?

I use the following request (getting a token by login and password):

url = 'http://oauth.vk.com/token'
scope = 'notify,photos,friends,audio,video,notes,pages,docs,status,questions,offers,wall,groups,messages, ' \
             'notifications,stats,ads,offline,stories,email,market'
params = dict(v=5.124, client_id=app_id, scope=scope, client_secret=app_secret,
                      grant_type='password', username=login, password=password)
res = requests.get(url, params=params, headers=headers, proxies=proxies, timeout=timeout)

But sometimes a response like this is returned:
{'extend_fields': ['birthday', 'avatar'], 'sid': 'c56defa93sdgf4ghd0c9cccbc', 'extend_fields_values': {'birthday': {'day': 21, 'year': 1977}}}

Although it should return access_token and other parameters

So, why does it not return and what needs to be done to get a token in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
ZIK1337, 2020-12-23
@ZIK1337

If you do not specify the API version in the request, then everything is returned normally ...
if anyone knows why, it would be interesting to read

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question