-
Notifications
You must be signed in to change notification settings - Fork 32
/
API.yml
127 lines (116 loc) · 3.61 KB
/
API.yml
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
115
116
117
118
119
120
121
122
123
124
125
126
127
#%RAML 0.8
title: Open mHealth Data Point API
version: v1.0.M1
baseUri: https://{endpointUrl}/{version}
baseUriParameters:
domain:
endpointUrl: the location of the API endpoint
type: string
mediaType: application/json
schemas:
- data-point: !include http://www.openmhealth.org/schema/omh/data-point-1.0.json
traits:
- paginated:
queryParameters:
skip:
description: the number of data points to skip
limit:
description: the number of data points to return
default: 100
securitySchemes:
- oauth_2_0:
type: OAuth 2.0
describedBy:
headers:
Authorization:
description: the access token
type: string
responses:
401:
description: the access token is not valid or has not been granted the required scope
settings:
authorizationUri: http://domain/oauth/authorize
accessTokenUri: http://domain/oauth/token
authorizationGrants: [code, token, owner]
scopes: [read_data_points, write_data_points, delete_data_points]
/dataPoints:
get:
description: get a list of data points matching some criteria
is: [ paginated ]
securedBy: [oauth_2_0]
queryParameters:
schema_namespace:
description: the namespace of the schema the data points conform to
type: string
pattern: "^[a-zA-Z0-9.-]+"
example: "omh"
required: true
schema_name:
description: the name of the schema the data points conform to
type: string
pattern: "[a-zA-Z0-9.-]+"
example: "blood-pressure"
required: true
schema_version:
description: the version of the schema the data points conform to
type: string
pattern: "\d+\.\d+(\.[a-zA-Z0-9]+)?"
example: "1.1.RC1"
required: true
created_on_or_after:
description: the earliest creation timestamp of the data points to return, inclusive, in ISO8601 format
type: string
example: "2013-02-05T07:25:00Z"
created_before:
description: the latest creation timestamp of the data points to return, exclusive, in ISO8601 format
type: string
example: "2013-04-05T07:25:00.123+03:00"
responses:
200:
description: a list of matching data points belonging to the user associated with the access token
body:
application/json:
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array",
"items": {
"data_point": {
"$ref": "http://www.openmhealth.org/schema/omh/data-point-1.0.json"
}
}
}
post:
description: create a data point
securedBy: [oauth_2_0]
body:
application/json:
schema: !include data-point
responses:
201:
description: the data point has been created
409:
description: a data point with the same identifier already exists
/{id}:
uriParameters:
id:
description: the identifier of the data point
type: string
get:
description: get a data point
securedBy: [oauth_2_0]
responses:
200:
body:
application/json:
schema: !include data-point
404:
description: the data point does not exist
delete:
description: delete a data point
securedBy: [oauth_2_0]
responses:
200:
description: the data point has been deleted
404:
description: the data point does not exist