The events queue can be accessed through GET rest api call to:
https://www.scalepoint.com/api/events/v1/dk/external/{tenant}/receive?lastEventId={eventid}.
For authentication the service requires a token with scope events obtained from the token endpoint described on the Authentication page.
The api uses long polling which means that the connection will be kept open until data is avaliable. It's adviced to call the api immediately on return or timeout, instead of calling on set intervals. That way, the caller will recieve events with minimal delay.
GET https://project0x.scalepoint.com/api/events/v1/dk/external/futureic/receive?lastEventId=_122046
Autorization: Bearer <Token with events scope>
Content-Type: application/json
{
"links": {
"next": "https://project0x.scalepoint.com/api/events/v1/dk/external/futureic/receive?lastEventId=_122048"
},
"meta": {},
"data": [
{
"id": "_122047",
"type": "case_created",
"timestamp": "2020-04-28T18:43:38.004451447Z",
"attributes": {
"eventType": "case_created",
"payloadVersion": "1.0.0",
"correlationId": "fcb07e62-af98-4b0c-b83a-3a4cdcf4bf9c",
"timestamp": "2020-04-28T20:43:35.0348577+02:00",
"case": {
"token": "ic.d474de7d-3895-4123-9cc6-8143e5481d0e",
"accidentDate": "2020-04-28T00:00:00Z",
"firstNotificationDate": "2020-04-28T20:43:27.7738068+02:00",
"company": "some company",
"sourceSystem": "some system"
},
"policy": {
"number": "900464"
}
}
},
{
"id": "_122048",
"type": "case_created",
"timestamp": "2020-04-28T18:56:48.007878689Z",
"attributes": {
"eventType": "case_created",
"payloadVersion": "1.0.0",
"correlationId": "fbf9d733-b575-47b4-8e13-5908e2f601bb",
"timestamp": "2020-04-28T20:56:45.0812148+02:00",
"case": {
"number": "SP20200428000019008",
"token": "sub.6a5bf862-a1e4-4c3b-9f64-09e7761170cc",
"accidentDate": "2020-02-02T00:00:00Z",
"firstNotificationDate": "2020-04-28T20:56:37.3420994+02:00",
"company": "some company"
},
"policy": {
"number": "7654"
}
}
}
]
}