There appeared a problem with the VK API. MESSAGES.GETHISTORY must return the dialogue history, but it does not return unread (new) messages. How can I get unread messages? Example request below
$ request_params = http_build_query (array (
'offset' = & gt; 0,
'Count' = & gt; 50,
'extended' = & gt; 1,
'peer_id' = & gt; $ peer_id
'Rev' = & gt; 0,
'start_message_id' = & gt; -1 ,
'Access_Token' = & gt; $ token
'v' = & gt; '5.103'
));
$ Options = Array (
'http' = & gt; Array (
'Header' = & gt; "Content-Type: Application / X-WWW-FORM-URLENCODED \ R \ N",
'Method' = & gt; 'Post',
'Content' = & gt; $ Request_params.
)
);
$ result = file_get_contents ('https://api.vk.com/method/messages.getHistory' ,False, Stream_Context_Create ($ Options));
Answer 1
solved the task. Do not use the Rev and Start_Message_ID parameters at the same time