Answer the question
In order to leave comments, you need to log in
How to upload a photo via VK API to Java desktop application?
Hello.
I've searched through a bunch of things and there is no sensible answer. How to upload a photo to the server using photos.getUploadServer and then save it to your group's album?
There is a piece of code. Variables ACCESS_TOKEN, USER_ID, ALBOM_ID, GROUP_ID of type int are defined at the beginning of the code by my data.
TransportClient transportClient = HttpTransportClient.getInstance();
VkApiClient vk = new VkApiClient(transportClient);
UserActor actor = new UserActor(USER_ID, ACCESS_TOKEN);
Response response = vk.photos().getUploadServer(actor).albumId(ALBOM_ID).groupId(GROUP_ID).execute();
vk.photos().saveWallPhoto(UserActor actor, String photo);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question