Stream your changes
Every create, update and delete in your own v3 data, as Server-Sent Events (text/event-stream), within about a second of the commit. Sample rows never change, so they send nothing. Each event has an id, an event name and one data line of JSON:
- ready: the stream is open. Read the data you show now; every change from here on comes as an event.
- change: one row was created, updated or deleted. data is a ChangeEvent; read the row at href for its new state.
- reset: your data changed as a whole (a reset of your data) or the stream lost its place. Read the data you show again.
A comment line : heartbeat comes every 25 seconds. The stream ends after 30 minutes, at the token's end, when the token is revoked, or when the server restarts; connect again after retry milliseconds and send the last id you got as Last-Event-ID. Within 5 minutes you get the events you missed, else reset. An event may come twice after a reconnect; drop one you have seen by its id. At most 3 streams per token and 10 per account on each server.
A browser EventSource cannot send a header: get a ticket from POST /stream/tickets and open ?ticket=<ticket>, with &last-event-id=<id> to resume. A ticket works once, also when the connect is refused (a 429, for one), so get a new one before every connect.
Request
- Base URLhttps://gorest.co.in/public/v3
- URLhttps://gorest.co.in/public/v3/stream/changes
- Auth
- HTTP bearer
- or API key in query parameter ticket
Query parameters
The same as the Last-Event-ID header, for EventSource with a ticket; the header wins when both come.
Headers
The id of the last event you got, to resume.
Response
The stream. Each event is id:, event: and data: lines and a blank line; data of change is a ChangeEvent, of ready and reset {}.
Changes
No recorded changes to this operation across all 1 revision of this API.