B
B
batchar2014-10-11 18:03:20
Python
batchar, 2014-10-11 18:03:20

What could be the error in getting a list of audio recordings from VK?

Hello!
I can't get access to audio recordings in VK in any way. I am using python lib . In the errors that have occurred, they stubbornly convince me that there are not enough rights. Or, all the same, the jamb in the library itself.

....
access_token =  8
vkapi = vk.API(vk_app_id, login, password)
vkapi.access_token = access_token
....

Traceback (most recent call last):
  File "Main.py", line 27, in <module>
    audios = vkapi.audio.get()
  File "/home/bat/apps/python/vkplayer/src/vk/api.py", line 214, in __call__
    return self._api_session(self._method_name, **method_kwargs)
  File "/home/bat/apps/python/vkplayer/src/vk/api.py", line 160, in __call__
    raise VkAPIMethodError(errors[0])
vk.api.VkAPIMethodError: 7. Permission to perform this action is denied.

Excerpt from the VK docks:
To gain access to most methods, you must obtain the appropriate rights for the current user. Application rights are a bitmask composed by summing the necessary rights codes.
...
+8 Access to audio recordings.
...
Maybe there really aren't enough rights? If so, how should they be assigned?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2014-10-11
@TsSaltan

access_token = 8

You need to get a token with audio rights
To do this, through the browser, follow the link like
https://oauth.vk.com/authorize?client_id= {Application_ID} &scope=audio,offline&redirect_uri=https%3A%2F%2Foauth.vk.com%2Fblank .html&response_type=code&display=page
Then it will issue a confirmation request, and then redirect to a blank page, access_token will be in the address bar after the = sign
vkapi = vk.API(vk_app_id, login, password)
why the password when requesting via api?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question