Answer the question
In order to leave comments, you need to log in
com.vk.api.sdk.exceptions.ApiParamException error. How to decide?
Error code:
Exception in thread "main" com.vk.api.sdk.exceptions.ApiParamException: One of the parameters specified was missing or invalid (100): One of the parameters specified was missing or invalid: message_ids is undefined
at com.vk.api.sdk.exceptions.ExceptionMapper.parseException(ExceptionMapper.java:117)
at com.vk.api.sdk.client.ApiRequest.executeWithoutRetry(ApiRequest.java:89)
at com.vk.api.sdk.client.ApiRequest.execute(ApiRequest.java:64)
at ru.likekey.main.vk.jobs.MessagesJob.<init>(MessagesJob.java:25)
at ru.likekey.main.Application.initJobs(Application.java:61)
at ru.likekey.main.Application.init(Application.java:50)
at ru.likekey.main.Application.main(Application.java:37)
Integer lastMessageId = 0;
public MessagesJob() throws ClientException, ApiException {
lastMessageId = DataStorage.getInstance().getInt(LAST_MESSAGE_ID_KEY); //Возвращает последний id сообщения из property файла
if (lastMessageId == 0) {
//Ошибка!
GetByIdResponse getResponse = Application.vk().messages().getById(Application.actor(), lastMessageId).execute();
if (!getResponse.getItems().isEmpty()) {
lastMessageId = getResponse.getItems().get(0).getId();
DataStorage.getInstance().add(LAST_MESSAGE_ID_KEY, String.valueOf(lastMessageId));
}
}
groupId = Application.groupId();
}
getById(com.vk.api.sdk.client.actors.GroupActor actor, Integer... messageIds)
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