Event Store API overview
Event Store API is designed to be consumed by external systems that requires events order. Example: Bookings BC wants to listen a specific event and needs to create projections in order to not depend on the realestate database.
Requests and Responses
Authentication
All requests are performed via HTTPS and use a JWT token in an Authorization header for each request.
Authorization: aa.bb.cc
There is only one role that can use this API:
uai_admin: The admin user role in U&I
Request format
The only supported content type is JSON.
Content-Type: application/json
Response format
The response content type is JSON.
Accept: application/json
Error format
Errors will use the most appropriate HTTP status code contained in an API Problem response.
{
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
"title": "Unauthorized",
"status": 401,
"detail": "Access denied to url 'http://local.spotahome.com:9090/api/monolith/event-store/4255670-4255674'"
}
Resource Group ¶
Get Domain Events ¶
Get Domain EventsGET/api/monolith/event-store/{fromEventId}-{toEventId}
Gets a specific set of domain events from a specific interval. A maximum of 500 results will be shown if more are requested.
Example URI
GET https://monolith.spotahome.com/api/monolith/event-store/api/monolith/event-store/fromEventId-toEventId
URI Parameters
- fromEventId
number(required)From domain event id
- toEventId
number(required)To domain event id
Request
Headers
Content-Type: application/json
Authorization: aa.bb.ccResponse
200Headers
Content-Type: application/jsonBody
{
"events": [
{
"typeName": "SAH\\BookingsPostPaid\\Domain\\NotifyBookingRequestCreationInitiated",
"occurredOn": "2017-07-03T11:20:35.000Z",
"eventBody": "{\"bookingRequestId\":102549,\"occurredOn\":\"2017-07-03T11:20:35+0000\"}"
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"events": {
"type": "array"
}
}
}Response
401Headers
Content-Type: application/jsonBody
{
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616",
"status": 401,
"detail": "Access denied to url 'https://spotahome.com/api/monolith/event"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "sec10.html,"
},
"status": {
"type": "number"
},
"detail": {
"type": "string",
"description": "store/4255670-4255674'"
}
}
}