Home php Messages.Gethistory does not return unread messages

Messages.Gethistory does not return unread messages

Author

Date

Category

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

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions