Event stream
All meaningful events can be streamed to one of your tenant's API endpoints. The tenant can even configure which types of events will be streamed to which of their endpoints.
Event stream application example
The event stream can be used to trigger the generation of emails by your back-end, such as an invitation to form a relationship with an asset. Although the client application making the original request could be configured to send an email upon receiving a positive response, this is less reliable. For example, the client application might be turned off by the user before sending the email. In addition, it is harder to resend a response to a client application than to a back-end.
Warning
When setting up your application, be aware of the following:
- Events might arrive out of chronological order.
- In rare cases, an event might be streamed twice. We advise to make subsequent actions idempotent to the extent possible.
Event stream content
The events that can be streamed are listed below. GET requests are not considered meaningful and therefore are not streamed.
Note
PII protection
All personally identifiable information (PII) is persistently stored in the identity management user repository only. The OneWelcome Identity Platform APIs do not persistently store any PII. Even though PII can temporarily occur in volatile memory, it is not kept in any database or log of the APIs.
-
Consent management: The audit log for user consents is stored separately and can currently not be streamed.
-
Relationship management:
Event | Properties |
---|---|
RELATIONSHIP_CREATED | requestor.id , requestor.type , from.id , from.type , to.id , to.type , relationshipType |
RELATIONSHIPS_DELETED | requestor.id , requestor.type , relationshipTypes , from.id , from.type , to.id , to.type |
INVITATION_CREATED | requestor.id , requestor.type , target.id , target.type , invitor.id , invitor.type , invitationId , invitee.contact.type , invitee.contact.value |
INVITATION_ACCEPTED | requestor.id , requestor.type , acceptor.id , acceptor.type , requestToken , invitationId |
INVITATION_WITHDRAWN | requestor.id , requestor.type , revocator.id , revocator.type , invitationId |
USER_UPSERTED | requestor.id , requestor.type , id , type ("user") |
USER_DELETED | requestor.id , requestor.type , id |
RESOURCE_UPSERTED | requestor.id , requestor.type , id , type |
RESOURCE_DELETED | requestor.id , requestor.type , id , type |
Event stream subscriptions
To set up the streaming of events, you must define a subscription for a specific API endpoint that will receive the events.
The auth attribute
We advise to protect the API endpoint with an authorization system, such as OAuth2. Details on how the event stream can request an access token for the endpoint via the OAuth2 Client Credentials grant type, can be included in the subscription's auth
.