Answer the question
In order to leave comments, you need to log in
How to bypass vk callback api data duplication?
The bottom line is that there is a post with a photo in the group , when a comment is added to the post, the same comment is attached to the photo and therefore two events, wall_reply_new and photo_comment_new, fire simultaneously. "duplicate" messages. I receive events in php://input
how do I process 2 simultaneous events at once so as not to duplicate the message in a personal, roughly speaking, if
wall_reply_new and photo_comment_new work for me at the same time, then I want to process only wall_reply_new
Answer the question
In order to leave comments, you need to log in
We solved it this way:
When receiving the photo_comment_new event, we make a request to the VK API https://api.vk.com/method/photos.getById and there we check if this image has a post_id, if so, then the picture is attached to the post and ignore these are notifications. wall_reply_new will come with it at the same time
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question