-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
288 lines (288 loc) · 14.1 KB
/
openapi.yaml
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
openapi: 3.0.1
servers:
-
url: 'http://localhost:8080/api'
description: localhost
-
url: 'https://play.dhis2.org/{version}/api'
description: DHIS2 demo server
variables:
version:
description: DHIS 2 release version
default: '2.28'
enum:
- '2.26'
- '2.27'
- '2.28'
- dev
info:
description: " The Web API is a component which makes it possible for external systems to access and manipulate data stored in an instance of DHIS2. More precisely, it provides a programmatic interface to a wide range of exposed data and service methods for applications such as third-party software clients, web portals and internal DHIS2 modules.\n### The Web API adheres to many of the principles behind the REST architectural style. To mention some few and important ones\n- The fundamental building blocks are referred to as *resources*. A resource can be anything exposed to the Web, from a document to a business process - anything a client might want to interact with. The information aspects of a resource can be retrieved or exchanged through resource representations. A representation is a view of a resource's state at any given time. For instance, the *reportTable* resource in DHIS2 represents a tabular report of aggregated data for a certain set of parameters. This resource can be retrieved in a variety of representation formats including HTML, PDF, and MS Excel.\n- All resources can be uniquely identified by a URI (also referred to a/s URL). All resources have a default representation. You can indicate that you are interested in a specific representation by supplying an Accept HTTP header, a file extension or a format query parameter. So in order to retrieve the PDF representation of a report table you can supply an ***Accept: application/pdf*** header or append ***.pdf*** or ***?format=pdf*** to your request URL.\n- Interactions with the API requires correct use of HTTP methods or verbs. This implies that for a resource you must issue a GET request when you want to retrieve it, POST request when you want to create one, PUT when you want to update it and DELETE when you want to remove it. So if you want to retrieve the default representation of a report table you can send a GET request to e.g. */reportTable/iu8j/hYgF6t*, where the last part is the report table identifier.\n- Resource representations are linkable, meaning that representations advertise other resources which are relevant to the current one by embedding links into itself (please be aware that you need to request href in your field filter to have this working. This feature greatly improves the usability and robustness of the API. For instance, you can easily navigate to the indicators which are associated with a report table from the reportTable resource through the embedded links using your preferred representation format. "
version: '2.29'
title: DHIS 2 API
termsOfService: ''
contact:
email: [email protected]
x-logo:
url: 'logo_banner.png'
tags:
- description: Constants are static values which can be made available to users for use in data elements and indicators.
name: Constants
x-displayName: Constants
paths:
/constants:
post:
summary: add a new constant definition
tags:
- Constants
description: ''
parameters: []
operationId: ''
requestBody:
required: true
content:
application/json:
schema:
properties:
name:
type: string
maxLength: 230
value:
type: string
format: double
description:
type: string
maxLength: 2147483647
shortName:
type: string
maxLength: 50
code:
type: string
maxLength: 50
uid:
type: string
maxLength: 11
required:
- name
description: 'Constants are static values which can be made available to users for use in data elements and indicators. Some indicators, such as "Couple year protection rate" depend on constants which usually do not change over time.'
example:
name: newConstant
value: '123.456'
shortName: nConst
displayName: nConst for display - ta da
description: a simple example of a constant
code: QWERTY12345
uid: bCqvfPR02Im
responses:
default:
description: Default response
put:
summary: update a constant definition
tags:
- Constants
description: ''
parameters: []
operationId: ''
requestBody:
required: true
content:
application/json:
schema:
properties:
name:
type: string
maxLength: 230
value:
type: string
format: double
description:
type: string
maxLength: 2147483647
shortName:
type: string
maxLength: 50
code:
type: string
maxLength: 50
uid:
type: string
maxLength: 11
required:
- name
description: 'Constants are static values which can be made available to users for use in data elements and indicators. Some indicators, such as "Couple year protection rate" depend on constants which usually do not change over time.'
example:
name: newConstant
value: '123.456'
shortName: nConst
displayName: nConst for display - ta da
description: a simple example of a constant
code: QWERTY12345
uid: bCqvfPR02Im
responses:
default:
description: Default response
get:
summary: get constants based on an applied filter
tags:
- Constants
description: ''
parameters:
-
name: fields
in: query
required: false
schema:
type: string
description: Fields to be returned by the query
example: ':all'
operationId: ''
responses:
default:
description: Default response
/constants/{uid}:
get:
summary: "get details of a constant based on it's unique ID"
tags:
- Constants
parameters:
-
in: path
name: uid
required: true
schema:
type: string
example: bCqvfPR02Im
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
name:
type: string
maxLength: 230
value:
type: string
format: double
description:
type: string
maxLength: 2147483647
shortName:
type: string
maxLength: 50
code:
type: string
maxLength: 50
uid:
type: string
maxLength: 11
required:
- name
description: 'Constants are static values which can be made available to users for use in data elements and indicators. Some indicators, such as "Couple year protection rate" depend on constants which usually do not change over time.'
example:
name: newConstant
value: '123.456'
shortName: nConst
displayName: nConst for display - ta da
description: a simple example of a constant
code: QWERTY12345
uid: bCqvfPR02Im
delete:
summary: "delete a constant based on it's unique ID"
tags:
- Constants
parameters:
-
in: path
name: uid
required: true
schema:
type: string
example: bCqvfPR02Im
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
name:
type: string
maxLength: 230
value:
type: string
format: double
description:
type: string
maxLength: 2147483647
shortName:
type: string
maxLength: 50
code:
type: string
maxLength: 50
uid:
type: string
maxLength: 11
required:
- name
description: 'Constants are static values which can be made available to users for use in data elements and indicators. Some indicators, such as "Couple year protection rate" depend on constants which usually do not change over time.'
example:
name: newConstant
value: '123.456'
shortName: nConst
displayName: nConst for display - ta da
description: a simple example of a constant
code: QWERTY12345
uid: bCqvfPR02Im
externalDocs:
description: ''
url: 'https://www.dhis2.org/documentation'
components:
schemas:
Constant:
properties:
name:
type: string
maxLength: 230
value:
type: string
format: double
description:
type: string
maxLength: 2147483647
shortName:
type: string
maxLength: 50
code:
type: string
maxLength: 50
uid:
type: string
maxLength: 11
required:
- name
description: 'Constants are static values which can be made available to users for use in data elements and indicators. Some indicators, such as "Couple year protection rate" depend on constants which usually do not change over time.'
example:
name: newConstant
value: '123.456'
shortName: nConst
displayName: nConst for display - ta da
description: a simple example of a constant
code: QWERTY12345
uid: bCqvfPR02Im
requestBodies: {}
securitySchemes:
basicAuth:
type: http
scheme: basic
oAuth:
type: openIdConnect
openIdConnectUrl: 'https://play.dhis2.org/api/oAuthClients'
links: {}
callbacks: {}
security:
-
basicAuth: []
-
oAuth: []