F
F
forgoty2018-08-04 20:14:24
Python
forgoty, 2018-08-04 20:14:24

Why does the server only return Access Denied 200 in the photos.get() method when accessing the Saved Photos album?

import vk
API_VERSION = 5.80
session = vk.AuthSession(app_id=APP_ID, user_login=user_login, user_password=user_password)
api = vk.API(session, v=API_VERSION, scope='photo')

response = api.photos.get(owner_id=profile.owner,
                                                     album_id='saved',
                                                     photo_sizes=1)

I get this:
vk.exceptions.VkAPIError: 200. Access denied. request_params = {'oauth': '1', 'method': 'photos.get', 'v': '5.8', 'scope': 'photo', 'owner_id': 'profile.owner', 'album_id': '-15', 'photo_sizes': '1'}

If you do this:
response = api.photos.get(owner_id=profile.owner,
                                                     album_id='wall',
                                                     photo_sizes=1)

That's all right.
Profile.owner contains the user ID. All albums don't have Privacy. That is, anyone can see them.
The most interesting thing is that if you make the same request through the site in the documentation for the photos.get () method, then everything returns as it should.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
forgoty, 2018-08-05
@forgoty

I found a similar problem in the VK bug tracker.
UPD: Saves can only be accessed using user_access_api!!
The service application API will not work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question