I don’t understand how User Long Poll API works. Can you tell? I figured it out with the Bots Long Poll API, but not really with the user. Two questions:
- How to make it clear to the VC server where to send events?
- How to handle events on my server?
I did this:
- First I got server, key and ts using messages.getLongPollServer.
I sent a request of this type from my server (as in the documentation):
https: // {$ server}? act = a_check & key = {$ key} & ts = {$ ts} & wait = 25 & mode = 2 & version = 3 changed the variables to those in clause 1
And then what? VC will send events to the address of the page from which the request was to item 2 or how?
If so, how to handle them? For example, you just need to write all the events to a file. Then I write in PHP like this:
header("Content-Type: text/html; charset=utf-8"); header("HTTP/1.0 200 OK"); $event = json_decode(file_get_contents('php://input'), true); file_put_contents('1.txt', $event); But something does not record anything. I send myself messages, and the file is empty.