-
Notifications
You must be signed in to change notification settings - Fork 12
/
api.raml
114 lines (111 loc) · 2.82 KB
/
api.raml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#%RAML 1.0
title: Somno Einstein API
mediaType: application/json
types:
Monitor:
type: object
properties:
mac_address:
description: "The MAC Address of the monitor, encoded as six groups of two lower-case hexadecimal digits separated by colons"
required: true
type: string
Observation:
description: "A measurement, e.g. a pulse of 75 bpm"
type: object
properties:
physio_id:
description: "Code identifying the represented value"
type: string
state:
description: "TODO Bit Field / flags describing state"
type: any
unit_code:
description: "Code identifying the units of measure"
type: string
value:
description: "The actual value of the measurement"
type: number
Payload:
description: "The payload of the webhook - metadata and list of observations"
type: object
properties:
monitor_id:
description: "The MAC Address of the monitor"
type: string
datetime:
type: datetime
observations:
type: Observation[]
Subscription:
type: object
properties:
subscription_id:
type: string
monitor_id:
type: string
url:
type: string
/api:
/monitors:
get:
responses:
200:
body:
Monitor[]
/monitor:
/{mac_address}:
/subscribe:
post:
description: "Subscribe to updates from the given monitor"
body:
example: |
{
"url": "https://example.com/callback/"
}
responses:
201:
body:
example: |
{ "subscription_id": "loremipsum" }
/subscribe:
/{subscription_id}:
delete:
/debug:
description: "Testing utilities etc. - anything here might change"
/subscriptions:
get:
responses:
200:
body:
Subscription[]
/examples:
/observation:
get:
description: "Returns an example Observation"
responses:
200:
body:
type: Observation
/payload:
get:
description: "Returns an example Payload"
responses:
200:
body:
type: Payload
example: |
{
"observations":
[
{
"state": [
"DEMO_DATA"
],
"physio_id": "NOM_PLETH_PULS_RATE",
"value": 42,
"unit_code": "NOM_DIM_BEAT_PER_MIN"
}
],
"monitor_id": "01:23:45:67:89:ab",
"datetime": "2018-07-31T13:50:35.071597"
}