Answer the question
In order to leave comments, you need to log in
How to post a photo on the wall in a VKontakte group?
First, I get a server link where I will send photos https://vk.com/dev/photos.getWallUploadServer.
I upload a photo and get a response containing the server id, photo, cash.
On https://vk.com/dev/photos.saveWallPhoto I describe all the fields, execute and get a response containing the id of the picture, its dimensions, links to pictures of different sizes.
The question remains how to publish the picture, because if you follow the documentation https://vk.com/dev/wall.post:
..&attachments=photo-{owner_id}_{media_id}&..
owner_id is the owner_id field, which is in the response to the call to saveWallPhoto
media_id - this is how I understood the standalone application id
Unfortunately, only the record is published, but without a photo
Answer the question
In order to leave comments, you need to log in
After saving the photo by the Photos.saveWallPhoto method , an array with the object of the loaded photo is returned , the "id" field is thus the "media_id", i.e. photo ID. "owner_id" is the ID of the owner of the photo, example: the owner is a user with id 192250250, photo id 450450450, this is the string for attachment photo192250250_450450450. For groups, the same thing, only the group id must be with a minus at the beginning photo-1_450450450.
Lines for other types of attachments are built according to the same principle: audio, video, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question