Webhook events
This page describes the different events you can get from our web hooks as a partner

Setting up webhooks

In your dashboard go to Data Links. There you can fill in your web-hook url and secret key.
Choose a long difficult secret and do not share you secret key with anyone
Once you have done this you can press the test button to check your implementation.
Here is a sample for express that can be used in a lambda serverless (node) to save these events to your own database:
index.js
1
const express = require("express")
2
const bodyParser = require("body-parser")
3
4
// Initialize express and define a port
5
const app = express()
6
const PORT = 3000
7
const KEY = 'mysecretkey'
8
9
// Tell express to use body-parser's JSON parsing
10
app.use(bodyParser.json())
11
12
app.post("/hook", (req, res) => {
13
if (req.headers['x-api-key'] !== KEY) return res.status(401).end()
14
console.log(req.body) // Call your action on the request here, save to db etc...
15
res.status(200).end() // Responding 200 is important
16
})
17
18
// Start express on the defined port
19
app.listen(PORT, () => console.log(`🚀 Server running on port ${PORT}`))
Copied!

Supported events

  • Samplers: appointmentCreated, appointmentUpdated, appointmentCancelled, appointmentCompleted, sampleUpdated
  • Labs: sampleReceived, sampleUpdated
  • Clients: codeUsed
  • Providers: appAuthorized, patientUpdated, sampleUpdated, appDeauthorized
  • All: dataDeletionRequest

Coming soon

  • Samplers, labs, clients: covidPositiveAlert
  • Checkers: resultVerified
More events can be added on request.

Examples

appointmentCreated, appointmentUpdated, appointmentCancelled

1
{
2
"eventName": "appointmentCreated",
3
"data": {
4
"dashboardUrl": "https://dashboard.daslab.app/samplers/123/appointments/123",
5
"userUrl": "https://web.daslab.app/appointments/123",
6
"appointmentId": 123,
7
"locationId": 123,
8
"datetime": "2020-11-16 10:00:00+00",
9
"paymentMethod": "stripe"
10
}
11
}
Copied!

dataDeletionRequest

For GDPR requests, please comply
1
{
2
"eventName": "dataDeletionRequest",
3
"data": {
4
"userId": 123,
5
"userEmail": "[email protected]",
6
"userPhoneNumber": "+39000000000"
7
}
8
}
Copied!

dataShareAccepted

For external applications
1
{
2
"eventName": "dataShareAccepted",
3
"data": {
4
"userId": 123,
5
"patientId": 123,
6
"integrationId": 123,
7
"userEmail": "[email protected]",
8
"userPhoneNumber": "+39000000000",
9
"scope": ["patientData","resultData"],
10
}
11
}
Copied!

sampleUpdated

When a result is added, or a sample is moved to your (lab) facility
1
{
2
"eventName": "sampleUpdated",
3
"data": {
4
"dashboardUrl": "https://dashboard.daslab.app/samplers/123/results/123",
5
"userUrl": "https://web.daslab.app/results/123",
6
"appointmentId": 123,
7
"locationId": 123,
8
"sampleId": 123,
9
"resultId": 123,
10
"patientId": 123
11
}
12
}
Copied!
Personal data about the patient or result will never be shared via the webhook, due to it being less secure. You would have to call our REST API for further details about the appointment.
Last modified 7mo ago