OPTIONS /events API.
Long Polling
Long polling involves opening an HTTP request and keeping it open until the server sends a response, then repeating the process over and over to receive updated responses.The SDKs have built-in support for turning the event feeds into an event
stream by long polling for new events.
Long Poll URL
To use long polling, first send an request to theOPTIONS /events API to retrieve the long poll URL.
Real-Time Servers
Next, make aGET request to the provided URL to begin listening for events. If
an event occurs in an account that is being monitored the application will
receive a response with the value new_change. The response contains no other
details.
This single response serves as a prompt to take further action such as
sending a request to the GET /events endpoint with the last known
stream_position.
Disconnect & Reconnect
After the server sends this response it closes the connection. The application must now repeat the long poll process to begin listening for events again. If no events occur for a while after the application connects to the real-time server the connection will close with areconnect value. When this happens the
application should make a new call to OPTIONS /events to restart the process.
Timeouts & Retries
If the application receive no events inretry_timeout seconds then the
application can reconnect to the real-time server. This might be necessary in
due to network errors.
If the application receive a max_retries error when making a GET request to
the real-time server then it must restart the process by making an OPTIONS call
to the /events API.
