Event Streaming
Get Streaming Events Connection Token
Retrieves a token for connecting to the realtime events streaming server used by browser/native clients. Enables a given client to receive pesorce updates as opposed to polling for changes.
The returned token will automatically subscribe the authenticated user to channels that the bearer token has scopes granted for.
Request
curl --request GET \
--url https://api.envoy.one/events/connection_token \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'
Response
{
"token": "eyJhbGciOi...PR7eNaJnfg"
}
undefined
Get Streaming Events Subscription Token
Retrieves a token for connecting to a given channel on the realtime events streaming server used by browser/native clients.
The returned token can be used to subscribe to the requested channel. This token is only necessary for private/user-limited channels. Public channels can be subscribed to directly once connection has been established using a connection token.
Attempting to join a channel for which the token does not have permission will result in a 403
error being returned.
Request
curl --request GET \
--url https://api.envoy.one/events/subscription_token \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}' \
--header 'Content-Type: application/json' \
--data '{"channel":"shipments:org_26ZZVNs2QURl4yY6owPARekUbMa#usr_26ZZVRrmnPTXTcZIuzXLZdnigLW"}'
Response
{
"token": "eyJhbGciOi...PR7eNaJnfg"
}
undefined
Provision Event Streaming for Organisation
Provisions an organisation on the events server such that it is able to receive real time events via streaming, or by webhooks.
Request
curl --request GET \
--url https://api.envoy.one/events/provision \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'
undefined
Deprovision Event Streaming for Organisation
Deprovisions an organisation on the events server. This involves deletion of any webhook endpoints that are setup for the organisation.
Request
curl --request GET \
--url https://api.envoy.one/events/deprovision \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'
undefined