F
F
fire_engel2020-07-05 14:02:21
Python
fire_engel, 2020-07-05 14:02:21

How to get an access key for attachments in VK?

I have a message with an attachment -- a photo. VK api allows you to get its ID in the userid_photoid format. Question: How can I get an access key for this photo? method

api.photos.getById(photos=str(event.attachments['attach1']))

throws a 200, access denied error.

update: noticed that the 200 error always occurs when I copy and paste an image into a dialog. When I take it from the saved photos, the error does not appear.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
putin2036, 2020-07-16
@putin2036

https://vk.com/dev/messages.getHistoryAttachments seems to help and https://vk.com/dev/errors

S
Saraman, 2020-07-05
@Saraman

Do you have access to this album?
Does the token have photo permission?

S
soremix, 2020-07-05
@SoreMix

How did you get the token?
What's in event.attachments['attach1'] if you print the value?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question