Receive events
Open a Server-Sent Events stream that delivers message and endpoint events for every endpoint of the authorized application.
Open a stream of events from agrirouter. Events fire for every endpoint of the authorized application and are delivered as Server-Sent Events (SSE): each event is a pair of lines, where event: names the event type and data: carries the JSON payload. See the Server-Sent Events specification for transport details.
For the catalog of event types and the full field list and sample frame of each one, see the Events page in the integration guide. The per-event payload schemas (named *EventData) are also rendered in the playground below.
Connection behaviour
- Filtering: pass
typesonce per event type to limit the stream, for exampleGET /events?types=MESSAGE_RECEIVED&types=FILE_RECEIVED. - Keep-alive: while idle, the gateway writes an SSE comment line (
: keep-alive) every 5 seconds. Treat a longer silence as a dead connection and reconnect. - Payload links:
payload_urivalues are pre-signed object storage URLs, valid for 15 minutes. See Payload downloads for the host to allow.
Agrirouter OAuth2 authentication for QA environment.
In: header
Query Parameters
Events type filter, if provided would limit the events returned to only those of the specified types. If not provided, all supported events will be streamed.
Response Body
text/event-stream
curl -X GET "https://api.agrirouter.com/events?types=MESSAGE_RECEIVED&types=FILE_RECEIVED&types=AUTHORIZATION_ADDED"{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"app_message_id": "string",
"message_type": "iso:11783:-10:taskdata:zip",
"sent_at": "2019-08-24T14:15:22Z",
"received_at": "2019-08-24T14:15:22Z",
"payload": "string",
"payload_uri": "http://example.com",
"event_type": "MESSAGE_RECEIVED",
"receiving_endpoint_id": "b9e017c3-df97-49b7-959c-adacbe4d7f41",
"sending_endpoint_id": "b6e1162a-f241-4dff-8b40-c8857b8f673d",
"filename": "string",
"tenant_id": "string",
"teamset_context_id": "string"
}