Answer the question
In order to leave comments, you need to log in
Vk. How do I post a photo to a group?
I can't figure out how attachments work in the wall.post method. I can post text, but I can't figure out how to upload a photo. In advance, many thanks for your help. I don't understand how to convert photo to this format - photo100172_166443618.
Read the documentation. https://vk.com/dev/wall.post
session = vk.Session(access_token = access_token)
vk_api = vk.API(session)
def post(vk_api, last_attachment)
vk_api.wall.post(v = '5.130',
owner_id = "-owner_id",
from_group = '0',
message = "sample_message",
attachments = "вот тут хз"
if __name__ == "__main__":
post(vk_api, last_attachment)
Answer the question
In order to leave comments, you need to log in
- If you need to post a limited set of pre-configured photos, you can send these photos to yourself on behalf of the community, then open them and pick them out of the address bar photoXXXXX_YYYYYY
- If you need to post dynamically loaded photos, then see the file upload docks: https://vk .com/dev/upload_files
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question